Get the latest tech news

Randomly selecting points inside a triangle


How to uniformly sample points from a triangle. One method that seems plausible but isn't uniform, and a clever method that is uniform.

Generate random numbers α, β, and γ from the interval [0, 1]. The method is fairly efficient; on average only half the points will be rejected. Every sample point will either land inside the original triangle or in its flipped twin.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Points

Points

Photo of triangle

triangle

Related news:

News photo

The Internet’s Biggest Travel Nerd Shares Pointers on Points

News photo

Pi in Pascal's Triangle (2014)

News photo

RenderFormer: Neural rendering of triangle meshes with global illumination