psimpl 7
|
Contains functions for calculating statistics and distances between various geometric entities. More...
Classes | |
struct | Statistics |
POD structure for storing several statistical values. More... | |
Functions | |
template<unsigned DIM, class InputIterator > | |
bool | equal (InputIterator p1, InputIterator p2) |
Determines if two points have the exact same coordinates. | |
template<unsigned DIM, class InputIterator , class OutputIterator > | |
OutputIterator | make_vector (InputIterator p1, InputIterator p2, OutputIterator result) |
Creates a vector from two points. | |
template<unsigned DIM, class InputIterator > | |
std::iterator_traits < InputIterator >::value_type | dot (InputIterator v1, InputIterator v2) |
Computes the dot product of two vectors. | |
template<unsigned DIM, class InputIterator , class OutputIterator > | |
OutputIterator | interpolate (InputIterator p1, InputIterator p2, float fraction, OutputIterator result) |
Peforms linear interpolation between two points. | |
template<unsigned DIM, class InputIterator1 , class InputIterator2 > | |
std::iterator_traits < InputIterator1 >::value_type | point_distance2 (InputIterator1 p1, InputIterator2 p2) |
Computes the squared distance of two points. | |
template<unsigned DIM, class InputIterator > | |
std::iterator_traits < InputIterator >::value_type | line_distance2 (InputIterator l1, InputIterator l2, InputIterator p) |
Computes the squared distance between an infinite line (l1, l2) and a point p. | |
template<unsigned DIM, class InputIterator > | |
std::iterator_traits < InputIterator >::value_type | segment_distance2 (InputIterator s1, InputIterator s2, InputIterator p) |
Computes the squared distance between a line segment (s1, s2) and a point p. | |
template<unsigned DIM, class InputIterator > | |
std::iterator_traits < InputIterator >::value_type | ray_distance2 (InputIterator r1, InputIterator r2, InputIterator p) |
Computes the squared distance between a ray (r1, r2) and a point p. | |
template<class InputIterator > | |
Statistics | compute_statistics (InputIterator first, InputIterator last) |
Computes various statistics for the range [first, last) |
Contains functions for calculating statistics and distances between various geometric entities.
Statistics psimpl::math::compute_statistics | ( | InputIterator | first, |
InputIterator | last | ||
) | [inline] |
Computes various statistics for the range [first, last)
[in] | first | the first value |
[in] | last | one beyond the last value |
std::iterator_traits<InputIterator>::value_type psimpl::math::dot | ( | InputIterator | v1, |
InputIterator | v2 | ||
) | [inline] |
Computes the dot product of two vectors.
[in] | v1 | the first coordinate of the first vector |
[in] | v2 | the first coordinate of the second vector |
bool psimpl::math::equal | ( | InputIterator | p1, |
InputIterator | p2 | ||
) | [inline] |
Determines if two points have the exact same coordinates.
[in] | p1 | the first coordinate of the first point |
[in] | p2 | the first coordinate of the second point |
OutputIterator psimpl::math::interpolate | ( | InputIterator | p1, |
InputIterator | p2, | ||
float | fraction, | ||
OutputIterator | result | ||
) | [inline] |
Peforms linear interpolation between two points.
[in] | p1 | the first coordinate of the first point |
[in] | p2 | the first coordinate of the second point |
[in] | fraction | the fraction used during interpolation |
[in] | result | the interpolation result (p1 + fraction * (p2 - p1)) |
std::iterator_traits<InputIterator>::value_type psimpl::math::line_distance2 | ( | InputIterator | l1, |
InputIterator | l2, | ||
InputIterator | p | ||
) | [inline] |
Computes the squared distance between an infinite line (l1, l2) and a point p.
[in] | l1 | the first coordinate of the first point on the line |
[in] | l2 | the first coordinate of the second point on the line |
[in] | p | the first coordinate of the test point |
OutputIterator psimpl::math::make_vector | ( | InputIterator | p1, |
InputIterator | p2, | ||
OutputIterator | result | ||
) | [inline] |
Creates a vector from two points.
[in] | p1 | the first coordinate of the first point |
[in] | p2 | the first coordinate of the second point |
[in] | result | the resulting vector (p2-p1) |
std::iterator_traits<InputIterator1>::value_type psimpl::math::point_distance2 | ( | InputIterator1 | p1, |
InputIterator2 | p2 | ||
) | [inline] |
Computes the squared distance of two points.
[in] | p1 | the first coordinate of the first point |
[in] | p2 | the first coordinate of the second point |
std::iterator_traits<InputIterator>::value_type psimpl::math::ray_distance2 | ( | InputIterator | r1, |
InputIterator | r2, | ||
InputIterator | p | ||
) | [inline] |
Computes the squared distance between a ray (r1, r2) and a point p.
[in] | r1 | the first coordinate of the start point of the ray |
[in] | r2 | the first coordinate of a point on the ray |
[in] | p | the first coordinate of the test point |
std::iterator_traits<InputIterator>::value_type psimpl::math::segment_distance2 | ( | InputIterator | s1, |
InputIterator | s2, | ||
InputIterator | p | ||
) | [inline] |
Computes the squared distance between a line segment (s1, s2) and a point p.
[in] | s1 | the first coordinate of the start point of the segment |
[in] | s2 | the first coordinate of the end point of the segment |
[in] | p | the first coordinate of the test point |