MutableRegularTriangle

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

Constructors

Link copied to clipboard
constructor(center: Vector2F, orientation: ComplexF, sideLength: Float)

Creates a new instance of MutableRegularTriangle.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val area: Float

Returns the area of this shape.

Link copied to clipboard
open override val center: Vector2F

Returns the center of this regular triangle.

Link copied to clipboard
open override val centroid: Vector2F

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

Link copied to clipboard
open override val circumcenter: Vector2F

Returns the circumcenter of this regular 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 override val circumradius: Float

Returns the circumradius of this shape.

Link copied to clipboard
open override val exteriorAngle: AngleF

Returns the exterior angle of this shape.

Link copied to clipboard
open override val incenter: Vector2F

Returns the incenter of this regular 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
open override val inradius: Float

Returns the inradius of this shape.

Link copied to clipboard
open override val interiorAngle: AngleF

Returns the interior angle of this shape.

Link copied to clipboard
open override val orientation: ComplexF

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

Link copied to clipboard
open override val orthocenter: Vector2F

Returns the orthocenter of this regular 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 override val pointA: Vector2F

Returns the point A of this regular triangle.

Link copied to clipboard
open override val pointB: Vector2F

Returns the point B of this regular triangle.

Link copied to clipboard
open override val pointC: Vector2F

Returns the point C of this regular 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 sideCount: Int

Returns the side count of this shape.

Link copied to clipboard
open override val sideLength: Float

Returns the side length of this shape.

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
fun calibrate()

Calibrates the properties of this instance. If the orientation cannot be normalized, it will take the value of ONE.

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

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

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

Returns the center of this regular triangle.

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

Returns the orientation of this regular triangle.

Link copied to clipboard
open operator override fun component3(): Float

Returns the sideLength of this regular triangle.

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

Returns true if this regular triangle contains the given point.

Link copied to clipboard
open override fun copy(center: Vector2F, orientation: ComplexF, sideLength: Float): MutableRegularTriangle

Returns a copy of this instance with specified properties changed.

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

Dilates this object around the point by a factor.

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

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

Link copied to clipboard

Indicates whether the other MutableRegularTriangle is equal to this one.

open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Sets this regular triangle with the result of interpolation from one regular triangle to another regular triangle by a factor.

Link copied to clipboard

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

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

Returns true if this regular triangle intersects the given ray.

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

Moves this object by a displacement.

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

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

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

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

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

Moves this object to the position.

Link copied to clipboard
open override fun pointIterator(): Vector2FIterator

Creates an iterator over the points of this regular triangle.

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

Rotates this object around the point by a rotation.

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

Rotates this object around the point to the orientation.

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

Rotates this object by a rotation.

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

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): MutableRegularTriangle
open override fun rotatedAroundPointTo(point: Vector2F, orientation: ComplexF): MutableRegularTriangle

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): MutableRegularTriangle
open override fun rotatedBy(rotation: ComplexF): MutableRegularTriangle

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

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

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

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

Rotates this object to the orientation.

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

Scales this object by a factor.

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

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

Link copied to clipboard
fun set(center: Vector2F = this.center, orientation: ComplexF = this.orientation, sideLength: Float = this.sideLength)

Sets the specified properties of this instance.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun transformBy(displacement: Vector2F, rotation: AngleF)
open override fun transformBy(displacement: Vector2F, rotation: ComplexF)

Transforms this object by moving by a displacement and rotating by a rotation.

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

Transforms this object by moving by a displacement, rotating by a rotation, and scaling by a scaleFactor.

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

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): MutableRegularTriangle
open override fun transformedBy(displacement: Vector2F, rotation: ComplexF, scaleFactor: Float): MutableRegularTriangle

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): MutableRegularTriangle
open override fun transformedTo(position: Vector2F, orientation: ComplexF): MutableRegularTriangle

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

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

Transforms this object by moving to the position and rotating to the orientation.