Picking random points in elliptic arc or sector

This was the result of random flashkit thread encounter and has no much real life value, probably. The closest thing I found to what that guy was asking for was this 2009 post explaining the trick to pick random point in the circle, but it is remarkably easy to extend it to the ellipse, or even arbitrary elliptic arc or sector. It is interesting in that you pick correct point on 1st try versus, for example, 4/π ≈ 1.27-th try if you simply select random point in ellipse bounding box and reject outliers – and some extra Math.xxx calls pay for that.

0 Responses to “Picking random points in elliptic arc or sector”



  1. Leave a Comment

Ask a Question

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Old stuff

February 2013
M T W T F S S
« Jan   Mar »
 123
45678910
11121314151617
18192021222324
25262728  

Oh, btw…


%d bloggers like this: