Remix.run Logo
Buffon's needle problem visualized(ivanludvig.dev)
25 points by IvanLudvig 4 days ago | 4 comments
IvanLudvig 4 days ago | parent | next [-]

context: https://en.wikipedia.org/wiki/Buffon's_needle_problem

millipede 2 days ago | parent | prev | next [-]

Picking a random orientation depends on trigonometric functions. In order for this to calculate, it would be a lot cooler if it didn't depend on transcendental functions.

LegionMammal978 2 days ago | parent [-]

You can pick a uniform random orientation without trig functions by first generating a random point in the unit disk via rejection sampling, then projecting it onto the boundary [0].

Of course, using rejection sampling for disk points will give you an estimate for π more directly.

[0] https://mathworld.wolfram.com/CirclePointPicking.html

nom a day ago | parent | prev [-]

It's not numerically converging for me, no matter how long I run it.