Skip to main content

Home > @jsplumbtoolkit/browser-ui > pointOnLine

pointOnLine() function

Calculates a point on the line from fromPoint to toPoint that is distance units along the length of the line.

Signature:

export declare function pointOnLine(fromPoint: PointXY, toPoint: PointXY, distance: number): PointXY;

Parameters

ParameterTypeDescription
fromPointPointXYFirst point
toPointPointXYSecond point
distancenumberDistance along the length that the point should be located.

Returns:

PointXY

Point on the line, in the form { x:..., y:... }.