Midpoint

Element

Midpoint of two points.

A midpoint is given by two points. It is collinear to the given points and the distance is the same to each of the given points, i.e. it is in the middle of the given points.

Usage (signatures)
board.create('midpoint', [p1, p2]);

The constructed point will be in the middle of p1 and p2.

Parameters
Name Type Description
p1 PointLike
p2 PointLike
Example

Midpoint between two points p1, p2 and of segment l1

// Create base elements: 2 points and 1 line
var p1 = board.create('point', [0.0, 2.0]);
var p2 = board.create('point', [2.0, 1.0]);
var l1 = board.create('segment', [[0.0, 3.0], [3.0, 3.0]]);

var mp1 = board.create('midpoint', [p1, p2]);
var mp2 = board.create('midpoint', [l1]);
board.create('midpoint', [l]);

The midpoint will be the xenter of the line segment l.

Parameters
Name Type Description
l Line

Throws

If the element cannot be constructed with the given parent objects an exception is thrown.

Type
Error

Details

Type
JXG.Point
Source
element/composition.js, line 593