Triangle

A Triangle is a polygon with three edges and three vertices.

Constructor

new Triangle(a, b, c)

Creates a new Triangle object from three points.

Parameters:
NameTypeDescription
aPoint2D

The first vertex of the triangle as Point2D.

bPoint2D

The second vertex of the triangle as Point2D.

cPoint2D

The third vertex of the triangle as Point2D.

Classes

Triangle

Members

a

Returns the first vertex of the triangle as Point2D.

area

Returns the area of the triangle.

b

Returns the second vertex of the triangle as Point2D.

c

Returns the third vertex of the triangle as Point2D.

perimeter

Returns the perimeter of the triangle.

Methods

vector_object_builder() → {VectorObjectBuilder}

Creates a VectorObjectBuilder with the triangle's points.

Returns:

A VectorObjectBuilder with the triangle's points.

Type: 
VectorObjectBuilder