Skip to content

cf_distance_sq

Category: math
GitHub: cute_math.h


Returns the square distance of a point to a line segment.

float cf_distance_sq(CF_V2 a, CF_V2 b, CF_V2 p)
Parameters Description
a The start point of a line segment.
b The end point of a line segment.
p The query point.

Remarks

See this article for implementation details.

CF_V2
CF_Ray