Classes | Functions
psimpl::math Namespace Reference

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<class InputIterator >
Statistics compute_statistics (InputIterator first, InputIterator last)
 Computes various statistics for the range [first, last) More...
 
template<unsigned DIM, class InputIterator >
std::iterator_traits< InputIterator >::value_type dot (InputIterator v1, InputIterator v2)
 Computes the dot product of two vectors. More...
 
template<unsigned DIM, class InputIterator >
bool equal (InputIterator p1, InputIterator p2)
 Determines if two points have the exact same coordinates. More...
 
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator interpolate (InputIterator p1, InputIterator p2, float fraction, OutputIterator result)
 Peforms linear interpolation between two points. More...
 
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. More...
 
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator make_vector (InputIterator p1, InputIterator p2, OutputIterator result)
 Creates a vector from two points. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

Contains functions for calculating statistics and distances between various geometric entities.

Function Documentation

◆ compute_statistics()

template<class InputIterator >
Statistics psimpl::math::compute_statistics ( InputIterator  first,
InputIterator  last 
)
inline

Computes various statistics for the range [first, last)

Parameters
[in]firstthe first value
[in]lastone beyond the last value
Returns
the calculated statistics

Definition at line 422 of file psimpl.h.

◆ dot()

template<unsigned DIM, class InputIterator >
std::iterator_traits<InputIterator>::value_type psimpl::math::dot ( InputIterator  v1,
InputIterator  v2 
)
inline

Computes the dot product of two vectors.

Parameters
[in]v1the first coordinate of the first vector
[in]v2the first coordinate of the second vector
Returns
the dot product (v1 * v2)

Definition at line 237 of file psimpl.h.

◆ equal()

template<unsigned DIM, class InputIterator >
bool psimpl::math::equal ( InputIterator  p1,
InputIterator  p2 
)
inline

Determines if two points have the exact same coordinates.

Parameters
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
Returns
true when the points are equal; false otherwise

Definition at line 192 of file psimpl.h.

◆ interpolate()

template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator psimpl::math::interpolate ( InputIterator  p1,
InputIterator  p2,
float  fraction,
OutputIterator  result 
)
inline

Peforms linear interpolation between two points.

Parameters
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
[in]fractionthe fraction used during interpolation
[in]resultthe interpolation result (p1 + fraction * (p2 - p1))
Returns
one beyond the last coordinate of the interpolated point

Definition at line 260 of file psimpl.h.

◆ line_distance2()

template<unsigned DIM, class InputIterator >
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.

Parameters
[in]l1the first coordinate of the first point on the line
[in]l2the first coordinate of the second point on the line
[in]pthe first coordinate of the test point
Returns
the squared distance

Definition at line 307 of file psimpl.h.

◆ make_vector()

template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator psimpl::math::make_vector ( InputIterator  p1,
InputIterator  p2,
OutputIterator  result 
)
inline

Creates a vector from two points.

Parameters
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
[in]resultthe resulting vector (p2-p1)
Returns
one beyond the last coordinate of the resulting vector

Definition at line 215 of file psimpl.h.

◆ point_distance2()

template<unsigned DIM, class InputIterator1 , class InputIterator2 >
std::iterator_traits<InputIterator1>::value_type psimpl::math::point_distance2 ( InputIterator1  p1,
InputIterator2  p2 
)
inline

Computes the squared distance of two points.

Parameters
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
Returns
the squared distance

Definition at line 285 of file psimpl.h.

◆ ray_distance2()

template<unsigned DIM, class InputIterator >
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.

Parameters
[in]r1the first coordinate of the start point of the ray
[in]r2the first coordinate of a point on the ray
[in]pthe first coordinate of the test point
Returns
the squared distance

Definition at line 384 of file psimpl.h.

◆ segment_distance2()

template<unsigned DIM, class InputIterator >
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.

Parameters
[in]s1the first coordinate of the start point of the segment
[in]s2the first coordinate of the end point of the segment
[in]pthe first coordinate of the test point
Returns
the squared distance

Definition at line 341 of file psimpl.h.



lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:28