# square_distance

square_distance, a Python code which computes the expected value of the distance between a pair of points randomly selected inside the unit square in 2D.

### Languages:

square_distance is available in a MATLAB version and a Python version.

### Related Data and Programs:

ball_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the interior of the unit ball in 3D.

circle_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected on the circumference of the unit circle in 2D.

cube_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the interior of the unit cube in 3D.

disk_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the interior of the unit disk in 2D.

hyperball_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the interior of the unit hyperball in M dimensions.

hypersphere_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected on the surface of the unit hypersphere in M dimensions.

line_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected in the unit line segment.

normal01_multivariate_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected from an isotropic standard normal distribution in M dimensions.

sphere_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected on the surface of the unit sphere in 3D.

triangle_distance, a Python code which considers the problem of describing the typical value of the distance between a pair of points randomly selected form the interior of a triangle in 2D.

### Reference:

• Paul Nahin,
Will You Be Alive 10 Years From Now?,
Princeton, 2014,
ISBN: 978-0691156804.
• Eric Weisstein,
Square Line Picking,
From MathWorld--A Wolfram Web Resource,
https://mathworld.wolfram.com/SquareLinePicking.html

### Source Code:

Last revised on 20 May 2019.