Page 2 of 2
Posted: Fri Jun 11, 2004 8:18 am
by angga888
lobow wrote:the result x' and y' will be the valors of C.
is it right?
I don't really understand your algo.
I interpret your steps this way:
Assume we want to build an equilateral triangle ABC. Now, we only know two points (A and B) and going to find the third one (point C).
Let's take an example:
the coordinate of A (0,0) and B (6,0), so the midpoint of AB is (3,0). Using your step we will get C (3,-3), and I think it's not an equilateral triangle.
Maybe if I don't misunderstand yours, you should use it in another way.
Posted: Fri Jun 11, 2004 3:15 pm
by lobow
I used the same way you showed this last post. At least when I used my way in your values I found the same C point.
But when I use in my program I get (6.710351,-6.710351).
The only thing that may be wrong then its the midpoint. What formula did you use to find it? I used (A+B)/2, maybe it is wrong.
Posted: Fri Jun 11, 2004 4:01 pm
by angga888
lobow wrote:The only thing that may be wrong then its the midpoint. What formula did you use to find it? I used (A+B)/2, maybe it is wrong.
Yes, same with mine.

Posted: Fri Jun 11, 2004 4:37 pm
by lobow
I saw an error in my formula. I was using the midpoint to rotate, but ill never find the C point with this (i think). Then I changed the x,y coordinates of the rotation axis to the point B and the point that I want to rotate to A, rotating 60
Posted: Fri Jun 11, 2004 6:21 pm
by angga888
More questions post me via PM.

Posted: Tue Sep 14, 2004 7:10 pm
by ..
angga888 wrote:Hi lobow,
I assume that the equilateral triangle always on the left side. I just try it and get the same result as the sample output. The problem description doesn't specify that. To get the points in an equilateral triangle, first I rotate the coordinates so that they become parallel to the x-axis or y-axis. After this, we can find all the points easilly. Next, I rotate them back again and get the real coordinates.
Hope it helps
Anggakusuma
I personally think that this method is not so "simple". I provided my method here. Given A, B, you can find C, D by ratio. And we know E are eqidistance from C, D. So I draw 2 circles using centers C, D and radius = distance(C, D). Then find the 2 intersection points of these 2 circles. Then you can use triangle-test to decided which intersection point is the required E.
