How can I map the coordinate of a copied triangle in a parallelogram to the original triangle? I've been reading the following article...
https://hbfs.wordpress.com/2010/10/05/random-points-in-a-triangle-generating-random-sequences-ii/
Which basically talks about how to generate a random point INSIDE of a triangle by:


*

*Making a copy of the triangle

*Transforming the copied triangle and joining the original triangle with the copied triangle to form a parallelogram.

*Generating a random point within the parallelogram.

*If the point is INSIDE of the COPIED triangle, map the point to the corresponding point in the ORIGINAL triangle.


I am currently on step 4 and I'm not understanding how exactly to transform the point into a point in the corresponding ORIGINAL triangle.
Could anyone help clarify how to accomplish this and what equation/formula is needed?

Basically, do the same thing you did to create the parallelogram in the first place: reflect the point in the center of the parallelogram, which is the midpoint of the common edge of the two triangles. Referring back to the second diagram in my answer to your previous question, let $P$ be any point on the paralellogram and $M$ the midpoint of a diagonal (it doesn’t matter which one since they bisect each other). Then the point $P'=M-(P-M)$ is the corresponding point on the opposite half of the paralellogram. Notice that this is exactly the same formula that you used to compute the fourth vertex of the paralellogram from the vertices of the original triangle.
