Skip to main content

Home > @jsplumb/util > normal

normal() function#

Calculates the gradient of a normal to a line between the two points.

Signature:

export declare function normal(p1: PointXY, p2: PointXY): number;

Parameters#

ParameterTypeDescription
p1PointXYFirst point in the line
p2PointXYSecond point in the line

Returns:

number

The gradient of a normal to a line between the two points.