midpoint
Calculates the midpoint between two pairs of (x,y) points.
- Destructure the array to get
x1
,y1
,x2
andy2
. - Calculate the midpoint for each dimension by dividing the sum of the two endpoints by
2
.
Calculates the midpoint between two pairs of (x,y) points.
x1
, y1
, x2
and y2
.2
.