ImmutableSegment



Represents a directed line segment between two points. See MutableSegment for mutable alternative.

Summary

Public constructors

ImmutableSegment(start: Vec, end: Vec)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

open ImmutableVec
Cmn
open ImmutableVec
Cmn

Inherited functions

From androidx.ink.geometry.Segment
ImmutableBox

Returns the minimum bounding box containing the Segment.

Cmn
MutableBox

Populates outBox with the minimum bounding box containing the Segment.

Cmn
ImmutableVec

Returns an ImmutableVec with the displacement from start to end.

Cmn
MutableVec

Populates outVec with the displacement from start to end.

Cmn
@FloatRange(from = 0.0) Float

The length of the Segment.

Cmn
ImmutableVec

Returns the point on the segment at the given ratio of the segment's length, measured from the start point.

Cmn
MutableVec
computeLerpPoint(ratio: Float, outVec: MutableVec)

Fills outVec with the point on the segment at the given ratio of the segment's length, measured from the start point.

Cmn
ImmutableVec

Returns an ImmutableVec that lies halfway along the segment.

Cmn
MutableVec

Populates outVec with the point halfway along the segment.

Cmn
Boolean
isAlmostEqual(other: Segment, tolerance: @FloatRange(from = 0.0) Float)

Compares this Segment with other, and returns true if both start points are considered almost equal with the given tolerance, and likewise for both end points.

Cmn
Float
project(pointToProject: Vec)

Returns the multiple of the segment's length at which the infinite extrapolation of this segment is closest to pointToProject.

Cmn

Public constructors

ImmutableSegment

ImmutableSegment(start: Vec, end: Vec)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

end

open val endImmutableVec

start

open val startImmutableVec