# ImmutableTriangle

Artifact: [androidx.ink:ink-geometry](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/geometry/ImmutableTriangle.kt+class:androidx.ink.geometry.ImmutableTriangle) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOS
- Cmn

  ```
  class ImmutableTriangle : Triangle
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.ink.geometry.Triangle](https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle) ||
|   | ↳ | [androidx.ink.geometry.ImmutableTriangle](https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle) |

*** ** * ** ***

An immutable triangle, defined by its three corners `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#(androidx.ink.geometry.Vec,androidx.ink.geometry.Vec,androidx.ink.geometry.Vec)`, `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#(androidx.ink.geometry.Vec,androidx.ink.geometry.Vec,androidx.ink.geometry.Vec)` and `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#(androidx.ink.geometry.Vec,androidx.ink.geometry.Vec,androidx.ink.geometry.Vec)` in order. This object is immutable, so it is inherently thread-safe. See `https://developer.android.com/reference/kotlin/androidx/ink/geometry/MutableTriangle` for the mutable version.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#ImmutableTriangle(androidx.ink.geometry.Vec,androidx.ink.geometry.Vec,androidx.ink.geometry.Vec)(p0: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec, p1: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec, p2: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec)` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Equality for `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle` is defined using the order in which `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p0()`, `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p1()` and `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p2()` are defined. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#hashCode()()` | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#toImmutable()()` Returns an immutable copy of this object. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p0()` One of the three points that define the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`. | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p1()` One of the three points that define the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`. | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableVec` | `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p2()` One of the three points that define the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`. | Cmn |

### Inherited functions

From [androidx.ink.geometry.Triangle](https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle) `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableBox` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeBoundingBox()()`

Returns the minimum bounding box containing the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`.
Cmn `https://developer.android.com/reference/kotlin/androidx/ink/geometry/MutableBox` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeBoundingBox(androidx.ink.geometry.MutableBox)(outBox: https://developer.android.com/reference/kotlin/androidx/ink/geometry/MutableBox)`

Populates `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeBoundingBox(androidx.ink.geometry.MutableBox)` with the minimum bounding box containing the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle` and returns `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeBoundingBox(androidx.ink.geometry.MutableBox)`.
Cmn `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableSegment` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`

Returns the segment of the Triangle between the point at `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int)` and the point at `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int)` + 1 modulo 3.
Cmn `https://developer.android.com/reference/kotlin/androidx/ink/geometry/MutableSegment` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int,androidx.ink.geometry.MutableSegment)(index: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, outSegment: https://developer.android.com/reference/kotlin/androidx/ink/geometry/MutableSegment)`

Fills `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int,androidx.ink.geometry.MutableSegment)` with the segment of the Triangle between the point at `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int,androidx.ink.geometry.MutableSegment)` and the point at `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeEdge(kotlin.Int,androidx.ink.geometry.MutableSegment)` + 1 modulo 3.
Cmn `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#computeSignedArea()()`

Return the signed area of the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`.
Cmn `operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#contains(androidx.ink.geometry.Vec)(point: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Vec)`

Returns true if the given point is contained within the Triangle.
Cmn `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle#isAlmostEqual(androidx.ink.geometry.Triangle,kotlin.Float)(other: https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle, tolerance: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Cmn

## Public constructors

### ImmutableTriangle

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

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

## Public functions

### equals

Cmn

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

Equality for `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle` is defined using the order in which `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p0()`, `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p1()` and `https://developer.android.com/reference/kotlin/androidx/ink/geometry/ImmutableTriangle#p2()` are defined. Rotated/flipped triangles with out-of-order vertices are not considered equal.

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toImmutable

Cmn

```
open fun toImmutable(): ImmutableTriangle
```

Returns an immutable copy of this object. This will return itself if called on an immutable instance.

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### p0

Cmn

```
open val p0: ImmutableVec
```

One of the three points that define the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`.

### p1

Cmn

```
open val p1: ImmutableVec
```

One of the three points that define the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`.

### p2

Cmn

```
open val p2: ImmutableVec
```

One of the three points that define the `https://developer.android.com/reference/kotlin/androidx/ink/geometry/Triangle`.