class Enlighten Triangle2D

This is the documentation for Enlighten.

class Enlighten Triangle2D

class Enlighten::Triangle2D

A triangle in 2D defined by three points.

Variables

Name

Description

Name

Description

Vertex2D m_A

First point.

Vertex2D m_B

Second point.

Vertex2D m_C

Third point.

Functions

Name

Description

Name

Description

Area()

Computes the unsigned area of the triangle.

AreaTimesTwo()

Computes the unsigned area of the triangle multiplied by two.

GetBarycentricCoordinates(const Vertex2D &)

Computes the barycentric coordinates for a point and this triangle.

GetBarycentricWeights(const Vertex2D &)

Computes the barycentric weights for a point and this triangle.

IsInsideExclusive(const Vertex2D &)

Tests if a point is truly inside the triangle, which excludes the edges of the triangle.

IsInsideExclusive(const Vertex2D &, const double &)

Tests if a point is inside the triangle incorporating a certain tolerance, which also excludes the edges defined by the triangle and this tolerance.

IsInsideInclusive(const Vertex2D &)

Tests if a point is inside the triangle including the edges of the triangle. This does not handle 0 area triangles.

NearestTriangleEdgeIntersection(Vertex2D &)

Computes the point on the triangle's edges that is closest to a given point.

SafeIsInsideInclusive(const Vertex2D &)

Tests if a point is inside the triangle including the edges of the triangle. Handles 0 area triangles.

Scale(double)

Componentwise scaling of the triangle.

Triangle2D()

Default constructor initialising the triangle to a point at (0,0).

Triangle2D(const Vertex2D &, const Vertex2D &, const Vertex2D &)

Constructor defining the three vertices of the triangle.

Validate()

Tests if the triangle is valid which means that all vertices are finite.



double Enlighten::Triangle2D::Area


public: double Area() const


Computes the unsigned area of the triangle.



double Enlighten::Triangle2D::AreaTimesTwo


public: double AreaTimesTwo() const


Computes the unsigned area of the triangle multiplied by two.



BaryCoords Enlighten::Triangle2D::GetBarycentricCoordinates


public: BaryCoords GetBarycentricCoordinates
(
    const Vertex2D & p
) const


Computes the barycentric coordinates for a point and this triangle.