ImmutableTriangle


class ImmutableTriangle : Triangle


An immutable triangle, defined by its three corners p0, p1 and p2 in order. This object is immutable, so it is inherently thread-safe. See MutableTriangle for the mutable version.

Summary

Public constructors

ImmutableTriangle(p0: Vec, p1: Vec, p2: Vec)

Public functions

open operator Boolean
equals(other: Any?)

Equality for ImmutableTriangle is defined using the order in which p0, p1 and p2 are defined.

open Int
open String

Public properties

open Vec

One of the three points that define the Triangle.

open Vec

One of the three points that define the Triangle.

open Vec

One of the three points that define the Triangle.

Inherited functions

From androidx.ink.geometry.Triangle
ImmutableBox

Returns the minimum bounding box containing the Triangle.

MutableBox

Populates outBox with the minimum bounding box containing the Triangle and returns outBox.

ImmutableSegment
computeEdge(index: @IntRange(from = 0, to = 2) Int)

Returns the segment of the Triangle between the point at index and the point at index + 1 modulo 3.

MutableSegment
computeEdge(index: @IntRange(from = 0, to = 2) Int, outSegment: MutableSegment)

Fills outSegment with the segment of the Triangle between the point at index and the point at index + 1 modulo 3.

Float

Return the signed area of the Triangle.

operator Boolean
contains(point: Vec)

Returns true if the given point is contained within the Triangle.

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

Public constructors

ImmutableTriangle

Added in 1.0.0-alpha01
ImmutableTriangle(p0: Vec, p1: Vec, p2: Vec)

Public functions

equals

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

Equality for ImmutableTriangle is defined using the order in which p0, p1 and p2 are defined. Rotated/flipped triangles with out-of-order vertices are not considered equal.

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

p0

Added in 1.0.0-alpha01
open val p0Vec

One of the three points that define the Triangle.

p1

Added in 1.0.0-alpha01
open val p1Vec

One of the three points that define the Triangle.

p2

Added in 1.0.0-alpha01
open val p2Vec

One of the three points that define the Triangle.