# template struct geom::TTriangle

## Overview

Template triangle in an arbitrary dimension. More…

    #include <GeometryStructures.h>

    template <size_t D>
    struct TTriangle {
        // typedefs

        typedef glm::vec<D, float> Vec;

        // fields

        Vec points[3];

        // methods

        Vec& operator[](size_t point_id);
        const Vec& operator[](size_t point_id) const;
        Vec GetCentroid() const;
    };

## Detailed Documentation

Template triangle in an arbitrary dimension.

### Methods

    Vec& operator[](size_t point_id)

Returns point with a specified index. Calling Triangle[0] is equivalent to Triangle.points[0].

    const Vec& operator[](size_t point_id) const

Returns point with a specified index. Calling Triangle[0] is equivalent to Triangle.points[0].

    Vec GetCentroid() const

Returns a centroid of the three triangle points.