Module geo.metric

Euclidean distance, length, and nearest-point operations.

Date

September 25, 2026

Functions

NameDescription
distance(a, b) Euclidean distance between two points.
dot(a, b) Computes the Euclidean dot product of two vectors.
norm(vector) Computes the Euclidean norm of a vector.
polylineLength(polyline) Euclidean length of a polyline.
segmentLength(segment) Euclidean length of a segment.
squaredDistance(a, b) Squared Euclidean distance between two points.
squaredNorm(vector) Computes the squared Euclidean norm of a vector.
tryNearestPoint(segment, point, result) Finds the nearest point on a segment to a point.
tryNearestPoint(line, point, result) Finds the nearest point on an unbounded Line2.
tryNormalize(vector, result) Constructs the unit direction of a finite non-zero vector.
tryPointSegmentDistance(segment, point, result) Computes the Euclidean distance from a point to a segment.
tryPointSegmentDistance(point, segment, result) Deprecated v1 point-first overload.
trySignedAngle(from, to, result) Computes the canonical signed angle from one vector to another.

Aliases

NameTypeDescription
MetricScalar real Floating-point computation type used by elementary metric operations.