Skip to main content

Home > @jsplumb/util > perpendicularLineTo

perpendicularLineTo() function#

Calculates a line of length length that is perpendicular to the line from fromPoint to toPoint and passes through toPoint.

Signature:

export declare function perpendicularLineTo(fromPoint: PointXY, toPoint: PointXY, length: number): LineXY;

Parameters#

ParameterTypeDescription
fromPointPointXYFirst point
toPointPointXYSecond point
lengthnumberLength of the line to generate

Returns:

LineXY

Perpendicular line of the required length.