Triangle

Represents a transformable triangle in a two-dimensional Euclidean space.

Implementations that use default-implemented members of this interface must make sure that the properties centroid, orientation, originPointA, originPointB, originPointC and the copy method are independent of other members and the computational complexity of these members is trivial.

Inheritors

Properties

Link copied to clipboard
open override val area: Float

Returns the area of this shape.

Link copied to clipboard
abstract val centroid: Vector2F

Returns the centroid of this triangle. Centroid is the intersection point of the triangle's medians. Centroid is the triangle's center of mass.

Link copied to clipboard

Returns the circumcenter of this triangle. Circumcenter is the intersection point of the perpendicular bisectors of the triangle's sides. Circumcenter is the center of the triangle's circumscribed circle.

Link copied to clipboard
open val incenter: Vector2F

Returns the incenter of this triangle. Incenter is the intersection point of the triangle's angle bisectors. Incenter is the center of the triangle's inscribed circle.

Link copied to clipboard
abstract val orientation: ComplexF

Returns the orientation of this object in reference to the origin of ComplexF.ONE.

Link copied to clipboard
abstract val originPointA: Vector2F

Returns the point A in reference to the triangle's centroid and orientation of ComplexF.ONE.

Link copied to clipboard
abstract val originPointB: Vector2F

Returns the point B in reference to the triangle's centroid and orientation of ComplexF.ONE.

Link copied to clipboard
abstract val originPointC: Vector2F

Returns the point C in reference to the triangle's centroid and orientation of ComplexF.ONE.

Link copied to clipboard

Returns the orthocenter of this triangle. Orthocenter is the intersection point of the triangle's altitudes.

Link copied to clipboard
open override val perimeter: Float

Returns the perimeter of this shape.

Link copied to clipboard
open val pointA: Vector2F

Returns the point A of this triangle.

Link copied to clipboard
open val pointB: Vector2F

Returns the point B of this triangle.

Link copied to clipboard
open val pointC: Vector2F

Returns the point C of this triangle.

Link copied to clipboard
open override val position: Vector2F

Returns the position of this object in reference to the origin of Vector2F.ZERO.

Link copied to clipboard
open override val sideLengthAB: Float

Returns the side length between points A and B of this triangle.

Link copied to clipboard
open override val sideLengthAC: Float

Returns the side length between points A and C of this triangle.

Link copied to clipboard
open override val sideLengthBC: Float

Returns the side length between points B and C of this triangle.

Functions

Link copied to clipboard
open fun closestPointTo(point: Vector2F): Vector2F

Returns the closest point on this triangle to the given point.

Link copied to clipboard
open operator fun component1(): Vector2F

Returns the centroid of this triangle.

Link copied to clipboard
open operator fun component2(): ComplexF

Returns the orientation of this triangle.

Link copied to clipboard
open operator fun component3(): Vector2F

Returns the originPointA of this triangle.

Link copied to clipboard
open operator fun component4(): Vector2F

Returns the originPointB of this triangle.

Link copied to clipboard
open operator fun component5(): Vector2F

Returns the originPointC of this triangle.

Link copied to clipboard
open operator fun contains(point: Vector2F): Boolean

Returns true if this triangle contains the given point.

Link copied to clipboard
abstract fun copy(centroid: Vector2F = this.centroid, orientation: ComplexF = this.orientation, originPointA: Vector2F = this.originPointA, originPointB: Vector2F = this.originPointB, originPointC: Vector2F = this.originPointC): Triangle

Returns a copy of this instance with specified properties changed.

Link copied to clipboard
open override fun dilatedBy(point: Vector2F, factor: Float): Triangle

Returns a copy of this object that is dilated around the point by a factor.

Link copied to clipboard
open fun interpolated(to: Triangle, by: Float): Triangle

Returns a copy of this triangle interpolated to other triangle by a factor.

Link copied to clipboard
open fun intersects(ray: Ray): Boolean

Returns true if this triangle intersects the given ray.

Link copied to clipboard
open override fun movedBy(displacement: Vector2F): Triangle

Returns a copy of this object that is moved by a displacement.

Link copied to clipboard
open override fun movedTo(position: Vector2F): Triangle

Returns a copy of this object that is moved to the position.

Link copied to clipboard

Creates an iterator over the origin points of this triangle.

Link copied to clipboard

Creates an iterator over the points of this triangle.

Link copied to clipboard
open override fun rotatedAroundPointBy(point: Vector2F, rotation: AngleF): Triangle
open override fun rotatedAroundPointBy(point: Vector2F, rotation: ComplexF): Triangle

Returns a copy of this object that is rotated around the point by a rotation.

Link copied to clipboard
open override fun rotatedAroundPointTo(point: Vector2F, orientation: AngleF): Triangle
open override fun rotatedAroundPointTo(point: Vector2F, orientation: ComplexF): Triangle

Returns a copy of this object that is rotated around the point to the orientation.

Link copied to clipboard
open override fun rotatedBy(rotation: AngleF): Triangle
open override fun rotatedBy(rotation: ComplexF): Triangle

Returns a copy of this object that is rotated by a rotation.

Link copied to clipboard
open override fun rotatedTo(orientation: AngleF): Triangle
open override fun rotatedTo(orientation: ComplexF): Triangle

Returns a copy of this object that is rotated to the orientation.

Link copied to clipboard
open override fun scaledBy(factor: Float): Triangle

Returns a copy of this object that is scaled by a factor.

Link copied to clipboard
open override fun transformedBy(displacement: Vector2F, rotation: AngleF): Triangle
open override fun transformedBy(displacement: Vector2F, rotation: ComplexF): Triangle

Returns a copy of this object that is moved by a displacement and rotated by a rotation.

open override fun transformedBy(displacement: Vector2F, rotation: AngleF, scaleFactor: Float): Triangle
open override fun transformedBy(displacement: Vector2F, rotation: ComplexF, scaleFactor: Float): Triangle

Returns a copy of this object that is moved by a displacement, rotated by a rotation, and scaled by a scaleFactor.

Link copied to clipboard
open override fun transformedTo(position: Vector2F, orientation: AngleF): Triangle
open override fun transformedTo(position: Vector2F, orientation: ComplexF): Triangle

Returns a copy of this object that is moved to the position and rotated to the orientation.