
-----------------------------------
appling
Sat Nov 08, 2003 4:15 pm

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. :cry:

-----------------------------------
Tony
Sat Nov 08, 2003 4:20 pm


-----------------------------------
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

-----------------------------------
appling
Sat Nov 08, 2003 4:28 pm


-----------------------------------
i don't mean that,
i have a Draw_Triangle  procedure
 
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 :wink:

and the randint must be used.

how could i do

-----------------------------------
Tony
Sat Nov 08, 2003 4:37 pm


-----------------------------------
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 :roll:

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

-----------------------------------
AsianSensation
Sat Nov 08, 2003 4:38 pm


-----------------------------------
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
Sat Nov 08, 2003 4:39 pm


-----------------------------------
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
Sat Nov 08, 2003 4:45 pm


-----------------------------------
thanks i see
