How to find coordinates of a 2d equilateral triangle in C?
I have the coordinates (x,y) of 2 points. I want to build the third point so that these 3 points make an equilateral triangle. How can I calculate the third point? Thank you After reading the posts (specially vkit's) I produced this simple piece of code which will do the trick for one direction (remember that there are two points). The modification for the other case shold be trivial. #include<stdio.h> #include<math.h> typedef struct{ double x; double y; } Point; Point vertex(Point p1, Point p2){ double s60 = sin(60 * M_PI / 180.0); double c60 = cos(60 * M_PI / 180.0); Point v = { c60 * (p1.x