Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
a isosceles triangle
Author Message
appling

Posted: Sat Nov 08, 2003 4:15 pm   Post subject: a isosceles triangle

how to make a calling instruction to create a isosceles triangle,
with x1,y1,x2,y2,x3,y3

i don't know how to do that.

Tony

Posted: Sat Nov 08, 2003 4:20 pm   Post subject: (No subject)

well think about it. You've got your 3 points, so just draw lines between them.

Draw.Line(x1,y1,x2,y2)
(x2,y2,x3,y3)
3,3 1,1
Tony's programming blog. DWITE - a programming contest.
appling

Posted: Sat Nov 08, 2003 4:28 pm   Post subject: (No subject)

i don't mean that,
i have a Draw_Triangle procedure
 code: procedure Draw_Triangle (C1, R1, C2, R2, C3, R3 : int)      drawline (C1, R1, C2, R2, 7)      drawline (C1, R1, C3, R3, 7)      drawline (C2, R2, C3, R3, 7) end Draw_Triangle

and this is for every triangle
now , i need to write a calling instruction to create an isosceles triangle using this procedure

and the randint must be used.

how could i do
Tony

Posted: Sat Nov 08, 2003 4:37 pm   Post subject: (No subject)

ohh... so isosceles triangle has same length for all 3 sides and 60 degree angles. You just randomly pick the length, and calculate other two points using trig

so you pick any X1/Y1

then X2 will be X1+ cosd(30)*length
Y2 will be Y1+ sind(30)*length

X3/Y3 will be same, but with -30 angle
Tony's programming blog. DWITE - a programming contest.
AsianSensation

Posted: Sat Nov 08, 2003 4:38 pm   Post subject: (No subject)

you have to calculate the distance between each points then. A circle would be the easiest if every single one of your points are random

generate one random point, then generate a random radius. Do the equation of a circle with origin your first point, and the radius with the one you just generated, then generate two more points that satisfy the equation, voila, you have your 3 points, then draw lines between them to make a triangle.

One thing you have to watch out for is when you generate those points with the equation of a circle, you don't want all your points to be on the same line.
AsianSensation

Posted: Sat Nov 08, 2003 4:39 pm   Post subject: (No subject)

tony wrote:
ohh... so isosceles triangle has same length for all 3 sides and 60 degree angles.

lol, tony forgot the definition of isosceles triangle. what you were talking about is an equilateral triangle, all three sides the same. But technically, an equilateral triangle is a isosceles triangle.
appling

Posted: Sat Nov 08, 2003 4:45 pm   Post subject: (No subject)

thanks i see
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 7 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: