ImmutableTriangle



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)
android

Public functions

open operator Boolean
equals(other: Any?)

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

android
open Int
android
open String
android

Public properties

open Vec

One of the three points that define the Triangle.

android
open Vec

One of the three points that define the Triangle.

android
open Vec

One of the three points that define the Triangle.

android

Inherited functions

From androidx.ink.geometry.Triangle
ImmutableBox

Returns the minimum bounding box containing the Triangle.

android
MutableBox

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

android
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.

android
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.

android
Float

Return the signed area of the Triangle.

android
operator Boolean
contains(point: Vec)

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

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

Public constructors

ImmutableTriangle

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

open val p0Vec

One of the three points that define the Triangle.

p1

open val p1Vec

One of the three points that define the Triangle.

p2

open val p2Vec

One of the three points that define the Triangle.