GEOS
3.6.1
|
Represents a planar triangle, and provides methods for calculating various properties of triangles. More...
#include <Triangle.h>
Public Member Functions | |
Triangle (const Coordinate &nP0, const Coordinate &nP1, const Coordinate &nP2) | |
void | inCentre (Coordinate &resultPoint) |
void | circumcentre (Coordinate &resultPoint) |
Public Attributes | |
Coordinate | p0 |
Coordinate | p1 |
Coordinate | p2 |
Represents a planar triangle, and provides methods for calculating various properties of triangles.
void geos::geom::Triangle::circumcentre | ( | Coordinate & | resultPoint | ) |
Computes the circumcentre of a triangle. The circumcentre is the centre of the circumcircle, the smallest circle which encloses the triangle. It is also the common intersection point of the perpendicular bisectors of the sides of the triangle, and is the only point which has equal distance to all three vertices of the triangle.
The circumcentre does not necessarily lie within the triangle. For example, the circumcentre of an obtuse isoceles triangle lies outside the triangle.
This method uses an algorithm due to J.R.Shewchuk which uses normalization to the origin to improve the accuracy of computation. (See Lecture Notes on Geometric Robustness, Jonathan Richard Shewchuk, 1999).
resultPoint | the point into which to write the inCentre of the triangle |
void geos::geom::Triangle::inCentre | ( | Coordinate & | resultPoint | ) |
The inCentre of a triangle is the point which is equidistant from the sides of the triangle. This is also the point at which the bisectors of the angles meet.
resultPoint | the point into which to write the inCentre of the triangle |