Thunderbots Project
Loading...
Searching...
No Matches
Triangle Class Reference

#include <triangle.h>

Inheritance diagram for Triangle:
Collaboration diagram for Triangle:

Public Member Functions

 Triangle (const Point &point1, const Point &point2, const Point &point3)
 
Point mean () const
 
- Public Member Functions inherited from ConvexPolygon
double area () const override
 
 ConvexPolygon (const std::vector< Point > &points)
 
 ConvexPolygon (const std::initializer_list< Point > &points)
 
- Public Member Functions inherited from Polygon
 Polygon (const std::vector< Point > &points)
 
 Polygon (const std::initializer_list< Point > &points)
 
Point centroid () const
 
Polygon expand (double expansion_amount) const
 
double perimeter () const
 
const std::vector< Segment > & getSegments () const
 
const std::vector< Point > & getPoints () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Polygon
static Polygon fromSegment (const Segment &segment, double length_radius, double width_radius)
 
static Polygon fromSegment (const Segment &segment, double radius)
 
- Protected Member Functions inherited from Polygon
void initSegments ()
 
- Protected Attributes inherited from Polygon
std::vector< Pointpoints_
 
std::vector< Segmentsegments_
 

Detailed Description

A triangle.

Constructor & Destructor Documentation

◆ Triangle()

Triangle ( const Point point1,
const Point point2,
const Point point3 
)
explicit

Creates a Triangle from three points.

Parameters
point1One of the triangle's corners
point2Another of the triangle's corners
point3One more of the triangle's corners

Member Function Documentation

◆ mean()

Point mean ( ) const

Returns the mean of all the points of this Triangle (also known as the center).

Returns
the mean of all the points of this Triangle

The documentation for this class was generated from the following files: