Skip to content

@technobuddha > library > Geometry > Line Segment

Function: lineLength()

ts
function lineLength(line: LineSegment): number;

Defined in: line-length.ts:14

Calculates the length of a line segment.

Parameters

ParameterTypeDescription
lineLineSegmentThe line segment for which to calculate the length.

Returns

number

The length of the line segment.

Example

typescript
lineLength({ x0: 0, y0: 0, x1: 3, y1: 4 }); // 5