emblem
Distance to points in circle
Computes the distance from a given point to the others, in a circle.
2024.Nov.25 05:32:05
x0 (x0 := |x0|) Location of given (source) point, (x0, 0). •
N   (≤ 1e+8) No. of random destination points. •
.seed, klass Seed for random numbers, and no. of histogram classes. •
Show values Shows the coordinates of the graph. •

Simulates, via Monte Carlo (limited time), the distances from the source point on the horizontal axis to N destination random points in a unit circle, in order to find the distribution of the distance, d. In the Figure, is shown a circle with the source point (black, at x = 0.6) and N = 100 random points (in the figure, from random polar coordinates).

The random destination points were computed through ρ.(cosθ, sinθ) from the following [Anon., 2014] algorithm:
    ρ = rand1 + rand2; if (ρ > 1) ρ = 2 − ρ; θ = 2 π rand0 .

The particular case of x0 = 0 leads to f(d) = 2d [Dartmouth, 2014], as is here suggested from experimenting.

Plots the density function (pdf), f(d), and the probability function (cdf), F(d), for the distance, d, and computes its mean and standard-deviation.

circle
References: Plate: distInCircle

• Wikipedia: Distance

• Wikipedia: Bertrand paradox (probability)

• Google: generate random points inside a circle.

• Dartmouth College, 2014, Chapter 2.pdf, "Continuous probability densities"

• Weisstein, Eric W., "Disk Point Picking", MathWorld—A Wolfram Web Resource

• Anonymous, 2014, Generate a random point within a circle uniformly.

• 1643-01-04: Newton, Sir Isaac (1727-03-31).

 
 
Valid HTML 4.01! IST http://web.ist.utl.pt/~mcasquilho/compute/or/Fx-distInCircle.php
Created: 2014-01-03 — Last modified: 2014-01-19