Randomly selecting points inside a triangle
Random points can be generated inside a triangle using three methods: barycentric coordinates (which doesn't produce uniform distribution), accept-reject (which discards points outside the triangle), or accept-flip (which uses a mirrored triangle to avoid waste). The accept-flip method efficiently creates uniform random points by keeping all generated points, sometimes after flipping them from a twin triangle back...