Triangle

data class Triangle(    val x1: Vector2,     val x2: Vector2,     val x3: Vector2) : ShapeProvider, ShapeContourProvider

Creates a simple three-point polygon.

Constructors

Link copied to clipboard
fun Triangle(    x1: Vector2,     x2: Vector2,     x3: Vector2)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
operator fun contains(v: Vector2): Boolean

Returns true if given v lies inside the Triangle.

Link copied to clipboard
operator fun div(scale: Double): Triangle
Link copied to clipboard
operator fun minus(right: Triangle): Triangle
Link copied to clipboard
operator fun plus(right: Triangle): Triangle
Link copied to clipboard
fun randomPoint(random: Random = Random.Default): Vector2

Generates a random point that lies inside the Triangle.

Link copied to clipboard
operator fun times(scale: Double): Triangle

Properties

Link copied to clipboard
val area: Double

The unitless area covered by this Triangle.

Link copied to clipboard
val centroid: Vector2

The centroid of the Triangle.

Link copied to clipboard
open override val contour: ShapeContour

Returns ShapeContour representation of the Triangle.

Link copied to clipboard
val reversed: Triangle
Link copied to clipboard
open override val shape: Shape

the provided shape

Link copied to clipboard
val x1: Vector2
Link copied to clipboard
val x2: Vector2
Link copied to clipboard
val x3: Vector2

Sources

Link copied to clipboard