Back to class index
LineSegment[Class Summary]
a
b
ctor (+3 overloads)
GetPoint(d)[const]
CenterPoint()[const]
Reverse()
Dir()[const]
AnyPointFast()[const]
ExtremePoint(direction)[const] (+1 overload)
Translate(offset)
Transform(transform) (+3 overloads)
Length()[const]
LengthSq()[const]
IsFinite()[const]
Equals(...)[const]
BitEquals(other)[const]
Contains(...)[const] (+1 overload)
ClosestPoint(point)[const] (+10 overloads)
Distance(point)[const] (+13 overloads)
DistanceSq(point)[const] (+1 overload)
Intersects(plane)[const] (+12 overloads)
IntersectsDisc(disc)[const]
ToRay()[const]
ToLine()[const]
ProjectToAxis(...)[const]
ToString()[const]
SerializeToString()[const]
SerializeToCodeString()[const]
FromString(str,outEndStr)[static] (+1 overload)

LineSegment::Length

Syntax

float LineSegment::Length() const; [4 lines of code]

Computes the length of this line segment.

Return Value

|b-a|.

See Also

a, b.

Syntax

float LineSegment::LengthSq() const; [4 lines of code]

Computes the squared length of this line segment.

Calling this function is faster than calling Length(), since this function avoids computing a square root. If you only need to compare lengths to each other and are not interested in the actual length values, you can compare by using LengthSq(), instead of Length(), since Sqrt() is an order-preserving (monotonous and non-decreasing) function.