 Right click this window and select "view source" in order to copy the source for this script.
Line Calculators
There are two calculators here, available for lines: a distance calculator and a midpoint calculator. Learn and enjoy...
Distance Calculator
Finds the length of a line. Just give the coordinates of the start
and end points of the line.
It uses Pythagoras' formula: the square of the hypotenuse is
equal to the sum of the squares on the other two sides.
D = sqr((X_{2}X_{1})^{2} +
(Y_{2}  Y_{1})^{2})
MidPoint Calculator
Consider the X values separately from the Y values. Subtract the
smaller X value from the larger one to get the distance along the X
axis between the two values. Now divide that by 2 to get half the
distance, and add that distance back to the lower value to get the
midpoint along the X axis. Now do the same for the Y values: Subtract
the smaller Y value from the larger one to get the distance, get half
that, and add it to the lower value.
