Triangle

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

Creates a simple three-point polygon.

Constructors

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

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun barycentric(position: Vector2): Vector3
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
Link copied to clipboard
operator fun times(scale: Double): Triangle

Properties

Link copied to clipboard

The unitless area covered by this Triangle.

Link copied to clipboard

The centroid of the Triangle.

Link copied to clipboard
open override val contour: ShapeContour

the provided contour

Link copied to clipboard
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