Function Repository Resource:

# RandomCircleChord

Generate a random chord of a circle

Contributed by: Sander Huisman
 ResourceFunction["RandomCircleChord"][type] returns a random chord of type type. ResourceFunction["RandomCircleChord"][type,n] returns n random chords of type type. ResourceFunction["RandomCircleChord"][type,n,format] returns n random chords of type type with the output format format.

## Details

ResourceFunction["RandomCircleChord"][] returns a single chord of the type: "TwoPointsOnCircle".
ResourceFunction["RandomCircleChord"][All] returns the list of possibles types type.
The type can be any of the following: "TwoPointsOnCircle", "TwoPointsInCircle", "PointInCircleAngle", "RadiusAngleMidpoint", "PointInCircleMidpoint", "CenterAngle":
The format can be any of the following: "EndPoints", "Line", "Lines", "Midpoints".

## Examples

### Basic Examples (2)

Generate a random circle chord:

 In[1]:=
 Out[1]=

Generate 100 random circle chords and visualize:

 In[2]:=
 Out[2]=

### Scope (6)

Retrieve all types:

 In[3]:=
 Out[3]=

By default, the chords are returns as a list of Line objects::

 In[4]:=
 Out[4]=

Get the endpoints of the chord:

 In[5]:=
 Out[5]=

Represent the chords as a single Line object:

 In[6]:=
 Out[6]=

Get the midpoints of each chord:

 In[7]:=
 Out[7]=

Generate 50 chords and return a single Line object:

 In[8]:=
 Out[8]=

### Applications (1)

Find the chance of each slice of a pie getting a candle given that the two candles are randomly placed and the cake randomly cut:

 In[9]:=
 Out[10]=

### Properties and Relations (1)

Compare the distribution of midpoints visually:

 In[11]:=
 Out[13]=

### Neat Examples (2)

Find the radial distribution of the midpoints:

 In[14]:=
 Out[15]=

Check the Bertrand paradox for a variety of ways of generating random chords:

 In[16]:=
 Out[18]=

SHuisman

## Version History

• 1.0.0 – 17 May 2022