|
| Triangle (const PointT &p0, const PointT &p1, const PointT &p2) |
|
constexpr uint | size () const |
| Returns the number of points of the triangle.
|
|
const PointT & | point (uint i) const |
| Returns the i-th point of the triangle.
|
|
PointT & | point (uint i) |
|
PointT & | point0 () |
|
const PointT & | point0 () const |
|
PointT & | point1 () |
|
const PointT & | point1 () const |
|
PointT & | point2 () |
|
const PointT & | point2 () const |
|
ScalarType | sideLength (uint i) const |
| Returns the length of the i-th side of the triangle.
|
|
ScalarType | sideLength0 () const |
| Returns the length of the first side of the triangle.
|
|
ScalarType | sideLength1 () const |
| Returns the length of the second side of the triangle.
|
|
ScalarType | sideLength2 () const |
| Returns the length of the third side of the triangle.
|
|
PointT | normal () const |
| Returns the normal of the triangle.
|
|
PointT | barycenter () const |
| Computes the barycenter of the triangle.
|
|
PointT | weightedBarycenter (ScalarType w0, ScalarType w1, ScalarType w2) const |
| Computes the weighted barycenter of the triangle.
|
|
PointT | weightedBarycenter (const Point3< ScalarType > &w) const |
| Computes the weighted barycenter of the triangle.
|
|
PointT | barycentricCoordinatePoint (ScalarType b0, ScalarType b1, ScalarType b2) const |
|
PointT | barycentricCoordinatePoint (const Point3< ScalarType > &b) const |
| Computes the point in the triangle with the given barycentric coordinates.
|
|
PointT | circumcenter () const |
| Compute the circumcenter of the triangle.
|
|
ScalarType | perimeter () const |
| Computes the perimeter of the triangle.
|
|
ScalarType | area () const |
| Computes the area of the triangle.
|
|
ScalarType | quality () const |
| Calculates the quality measure of the triangle.
|
|
ScalarType | qualityRadii () const |
| Compute a shape quality measure of the triangle.
|
|
ScalarType | qualityMeanRatio () const |
| Compute the mean ratio of the triangle shape quality measure.
|
|
ScalarType | sideLength (const PointT &p0, const PointT &p1, const PointT &p2, uint i) const |
| Returns the length of the i-th side of the triangle composed by the points p0 , p1 , and p2 .
|
|
|
static PointT | normal (const PointT &p0, const PointT &p1, const PointT &p2) |
| Computes the normal of the triangle composed by the 3D points p0 , p1 , and p2 , considering that these three points are ordered in counter-clockwise order.
|
|
static PointT | barycenter (const PointT &p0, const PointT &p1, const PointT &p2) |
| Computes the barycenter of the triangle composed by the points p0 , p1 , and p2 .
|
|
static PointT | weightedBarycenter (const PointT &p0, const PointT &p1, const PointT &p2, ScalarType w0, ScalarType w1, ScalarType w2) |
| Computes the weighted barycenter of a triangle composed of three points.
|
|
static PointT | barycentricCoordinatePoint (const PointT &p0, const PointT &p1, const PointT &p2, ScalarType b0, ScalarType b1, ScalarType b2) |
| Computes the point in a triangle with the given barycentric coordinates.
|
|
static PointT | circumcenter (const PointT &p0, const PointT &p1, const PointT &p2) |
| Compute the circumcenter of a triangle.
|
|
static ScalarType | perimeter (const PointT &p0, const PointT &p1, const PointT &p2) |
| Computes the perimeter of the triangle composed by the points p0 , p1 , and p2 .
|
|
static ScalarType | area (const PointT &p0, const PointT &p1, const PointT &p2) |
| Computes the area of the triangle composed by the points p0 , p1 , and p2 , considering that these three points are ordered in counterclockwise order.
|
|
static ScalarType | quality (const PointT &p0, const PointT &p1, const PointT &p2) |
| Calculates the quality measure of a triangle, given its three vertices.
|
|
static ScalarType | qualityRadii (const PointT &p0, const PointT &p1, const PointT &p2) |
| Compute a shape quality measure of the triangle composed by points p0 , p1 , p2 .
|
|
static ScalarType | qualityMeanRatio (const PointT &p0, const PointT &p1, const PointT &p2) |
| Compute the mean ratio of a triangle shape quality measure.
|
|
template<PointConcept PointT>
static PointT vcl::Triangle< PointT >::barycentricCoordinatePoint |
( |
const PointT & |
p0, |
|
|
const PointT & |
p1, |
|
|
const PointT & |
p2, |
|
|
ScalarType |
b0, |
|
|
ScalarType |
b1, |
|
|
ScalarType |
b2 |
|
) |
| |
|
inlinestatic |
Computes the point in a triangle with the given barycentric coordinates.
Given a triangle with vertices p0
, p1
, and p2
, and a set of barycentric coordinates b0
, b1
and b2
, this function computes the point in the triangle corresponding to those barycentric coordinates.
- Parameters
-
[in] | p0 | The first vertex of the triangle. |
[in] | p1 | The second vertex of the triangle. |
[in] | p2 | The third vertex of the triangle. |
[in] | b0 | The first barycentric coordinate of the point in the triangle. |
[in] | b1 | The first barycentric coordinate of the point in the triangle. |
[in] | b2 | The first barycentric coordinate of the point in the triangle. |
- Returns
- The point in the triangle corresponding to the given barycentric coordinates.
template<PointConcept PointT>
Compute the circumcenter of a triangle.
Given three points p0
, p1
, p2
representing a triangle, the function computes the circumcenter of the triangle, which is the center of the circle that passes through the three vertices of the triangle. The circumcenter is defined as the intersection of the perpendicular bisectors of the three sides of the triangle.
- Template Parameters
-
PointType | A type that satisfies the PointConcept. |
- Parameters
-
[in] | p0 | The first point of the triangle. |
[in] | p1 | The second point of the triangle. |
[in] | p2 | The third point of the triangle. |
- Returns
- The circumcenter of the triangle.
- Note
- The function assumes that the three points are not collinear and form a valid triangle.
template<PointConcept PointT>
Calculates the quality measure of the triangle.
The quality measure is computed as 2 times the triangle's area divided by the square of the length of its longest edge. The resulting value is in the range [0.0, 0.866], where 0.0 represents a degenerate triangle and 0.866 represents an equilateral triangle.
- Returns
- The quality measure of the triangle.
- Note
- If the area of the triangle is zero (i.e., the vertices are collinear), the function returns 0.0.
template<PointConcept PointT>
Calculates the quality measure of a triangle, given its three vertices.
The quality measure is computed as 2 times the triangle's area divided by the square of the length of its longest edge. The resulting value is in the range [0.0, 0.866], where 0.0 represents a degenerate triangle and 0.866 represents an equilateral triangle.
- Parameters
-
[in] | p0 | The first vertex of the triangle. |
[in] | p1 | The second vertex of the triangle. |
[in] | p2 | The third vertex of the triangle. |
- Returns
- The quality measure of the triangle.
- Note
- If the area of the triangle is zero (i.e., the vertices are collinear), the function returns 0.0.
template<PointConcept PointT>
Compute the mean ratio of the triangle shape quality measure.
The function computes the mean ratio shape quality measure of the triangle. The mean ratio is defined as 2 * sqrt(a * b) / (a + b), where a and b are the eigenvalues of the M^tM transformation matrix into a regular simplex. The mean ratio is a scalar value in the range [0, 1] that describes the triangle quality, where 0 means the triangle is degenerate, and 1 means it is perfectly equilateral.
- Returns
- The mean ratio shape quality measure of the triangle.
- Note
- If the three points are collinear or form a degenerate triangle, the function returns 0.
template<PointConcept PointT>
Compute the mean ratio of a triangle shape quality measure.
Given three points p0
, p1
, p2
representing a triangle, the function computes the mean ratio shape quality measure of the triangle. The mean ratio is defined as 2 * sqrt(a * b) / (a + b), where a and b are the eigenvalues of the M^tM transformation matrix into a regular simplex. The mean ratio is a scalar value in the range [0, 1] that describes the triangle quality, where 0 means the triangle is degenerate, and 1 means it is perfectly equilateral.
- Parameters
-
[in] | p0 | The first point of the triangle. |
[in] | p1 | The second point of the triangle. |
[in] | p2 | The third point of the triangle. |
- Returns
- The mean ratio shape quality measure of the triangle.
- Note
- The function assumes that the three points are not collinear and form a valid triangle. If the three points are collinear or form a degenerate triangle, the function returns 0.
template<PointConcept PointT>
Compute a shape quality measure of the triangle composed by points p0
, p1
, p2
.
This function computes the quality measure of a triangle based on the ratio between its inradius and circumradius. The function takes three points (p0
, p1
, p2
) representing the vertices of the triangle.
- Parameters
-
[in] | p0 | The first vertex of the triangle. |
[in] | p1 | The second vertex of the triangle. |
[in] | p2 | The third vertex of the triangle. |
- Returns
- A value between 0 and 1 that represents the quality of the triangle shape. A value of 1 means the triangle is perfectly equilateral, while lower values indicate more distorted shapes (i.e., halfsquare: 0.81). A value of 0 is returned when the triangle is degenerate (i.e., it has zero area).