Line2
struct Line2import Line2 from Wax;A finite 2D line segment between start and end. Closest-point queries clamp to the segment; coincident endpoints represent a single point.
Members
startfield
public float2 startThe first endpoint.
endfield
public float2 endThe second endpoint.
constructorconstructor
public constructor (float2 start, float2 end)Stores both endpoints.
lengthgetter
public get length() : floatThe Euclidean distance between endpoints.
directiongetter
public get direction() : float2The normalized end-minus-start vector, or zero for coincident endpoints.
ClosestPointmethod
public fn ClosestPoint(float2 point) : float2Returns the closest point on the closed segment. Coincident endpoints return start.
DistanceTomethod
public fn DistanceTo(float2 point) : floatReturns the Euclidean distance to the closest point on the closed segment.
ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.