EquilateralTriangle

An EquilateralTriangle is a triangle in which all three sides are equal in length.

Constructor

new EquilateralTriangle(center, side_length, rotationopt)

Creates a new EquilateralTriangle from a center point and side length.

Parameters:
NameTypeAttributesDescription
centerPoint2D

The center Point2D of the equilateral triangle.

side_lengthnumber

The side length of the equilateral triangle.

rotationnumber | null<optional>

The rotation of the equilateral triangle, if any.

Classes

EquilateralTriangle

Members

area

Returns the area of the equilateral triangle.

center

Returns the center Point2D of the equilateral triangle.

height

Returns the height of the equilateral triangle.

perimeter

Returns the perimeter of the equilateral triangle.

side_length

Returns the side length of the equilateral triangle.

triangle

Creates a Triangle from the equilateral triangle.

vector_object_builder

Creates a VectorObjectBuilder from the equilateral triangle.