#include <CGAL/Barycentric_coordinates_2/Triangle_coordinates_2.h>
The class Triangle_coordinates_2
implements barycentric coordinates ( [1], [2] ) with respect to an arbitrary non-degenerate triangle in the plane.
This class is parameterized by a traits class Traits
.
- Template Parameters
-
- Examples:
- Barycentric_coordinates_2/Triangle_coordinates_example.cpp, and Barycentric_coordinates_2/Triangle_coordinates_speed_test.cpp.
|
(Note that these are not member functions.)
|
template<class Traits > |
std::array< typename Traits::FT, 3 > | compute_triangle_coordinates_2 (const typename Traits::Point_2 &first_vertex, const typename Traits::Point_2 &second_vertex, const typename Traits::Point_2 &third_vertex, const typename Traits::Point_2 &query_point, const Traits &barycentric_traits=Traits()) |
|
◆ Vertex_range
Range of vertices in a triangle.
This type is a model of the concept Range
. Its iterator type is RandomAccessIterator
, and its value type is Traits::Point_2
.
◆ Triangle_coordinates_2()
Creates the class Triangle_coordinates_2
that implements triangle coordinates with respect to an arbitrary non-degenerate triangle in the plane.
The triangle is given by its three vertices.
- Precondition
- Triangle is not degenerate.
◆ operator()()
template<class Traits >
template<class OutputIterator >
Computes triangle barycentric coordinates for a chosen query point with respect to all three vertices of the triangle.
Computed coordinates are stored in the output iterator output
.
◆ compute_triangle_coordinates_2()
template<class Traits >
std::array< typename Traits::FT, 3 > compute_triangle_coordinates_2 |
( |
const typename Traits::Point_2 & |
first_vertex, |
|
|
const typename Traits::Point_2 & |
second_vertex, |
|
|
const typename Traits::Point_2 & |
third_vertex, |
|
|
const typename Traits::Point_2 & |
query_point, |
|
|
const Traits & |
barycentric_traits = Traits() |
|
) |
| |
|
related |
This is a global function that takes three vertices of a triangle and computes triangle coordinates at a given query point with respect to these vertices.
- Template Parameters
-