How to flip one point of a triangle

706 Views Asked by At

How to flip one point of a triangle when other two remains fixed. Like the following image, enter image description here

Here the top point of the triangle A is flipped to triangle B when other two points remained fixed. The triangle can have arbitrary shape and orientation. I have the coordinate of all 3 points. The flip will be on the other side of the fixed side made by the fixed two points.

2

There are 2 best solutions below

0
On BEST ANSWER

Suppose you want to flip triangle $ABC$ to $A'BC$, and let $C'$ be the projection of $A$ onto line $BC$. We have $$ \vec{BC'}={\vec{BA}\cdot\vec{BC}\over BC^2}\vec{BC} $$ and $$ \vec{AA'}=2\vec{AC'}=2(\vec{BC'}-\vec{BA})=2\left({\vec{BA}\cdot\vec{BC}\over BC^2}\vec{BC}-\vec{BA}\right). $$

2
On

Let $$A=(x_1,y_1)$$ $$B=(x_2,y_2)$$ $$C=(x_3,y_3)$$ and lets call the point after flipping be $$A'=(x,y)$$

$$\vec{BC}=(x_2-x_3,y_2-y_3)$$ $$\vec{AA'}=(x_1-x,y_1-y)$$ So your first equation becomes $$\vec{BC}\cdot \vec{AA'}=0$$

Your second equation becomes $$|AC|=|A'C|$$ This is because as your taking the mirror image side length should be same. Solving both the equations together you will find value of $x,y$