Skip to content

editor / midpoint

Function: midpoint() ​

midpoint(start, end): Point

Defined in: math/midpoint.ts:15

Middle of a segment: the point dividing it into two segments of equal length.

Formula: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). Halving is exact in binary floating point, so the only rounding is the one of each sum.

Parameters ​

start ​

Point

one end of the segment

end ​

Point

the other end

Returns ​

Point

the middle of the segment

Kind ​

math

See ​

REF-MATHWORLD-MIDPOINT