aimstil  5.0.5
til::geo Namespace Reference

Classes

struct  AreIntersecting
 A namespace structure collecting geometrical object intersection algorithms. More...
 
struct  IsIncludedIn
 A namespace structure collecting geometrical object inclusion algorithms. More...
 
struct  Project
 A namespace structure collecting geometrical projection algorithms. More...
 
class  Triangle2Segment
 Approximate an ill-conditionned triangle by a segment. More...
 
class  TriangleNormal
 Compute the normal of a triangle. More...
 

Functions

template<typename T >
herons_formula (T a, T b, T c)
 Heron's formula. More...
 
template<typename T >
herons_formula (numeric_array< T, 3 > const &lengths)
 Heron's formula. More...
 
template<typename T >
law_of_cosines (T a, T b, T c)
 Returns the cosine of angle A given the lengths of the triangle edges. More...
 
template<typename T >
law_of_tangents (T a, T b, T c, T area)
 Returns the tangent of angle A given the area and the lengths of the edges of the triangle. More...
 
template<typename T >
law_of_tangents (T a, T b, T c)
 Returns the tangent of angle A given the lengths of the edges of the triangle. More...
 
template<typename T >
angle (T x, T y, T norm)
 Returns the angle between (x,y) and the x-axis, with the norm of (x,y) provided. More...
 
template<typename T >
angle (T x, T y)
 Returns the angle between (x,y) and the x-axis. More...
 
template<typename T >
void cartesian2spherical (T x, T y, T z, T &theta, T &phi, T &rho)
 Converts cartesian coordinates into spherical coordinates. More...
 
template<typename T >
void spherical2cartesian (T theta, T phi, T rho, T &x, T &y, T &z)
 Converts spherical coordinates into cartesian coordinates. More...
 
template<typename TArray >
bool triangle2segment (const TArray &A, const TArray &B, const TArray &C, TArray &X, TArray &Y)
 
template<typename TArray , typename TResArray >
bool triangle_normal (const TArray &A, const TArray &B, const TArray &C, TResArray &result)
 Compute the normal of a triangle. More...
 
template<typename TPrec , typename TPoint >
bool is_in_circumcircle (const TPoint &p, const TPoint &a, const TPoint &b, const TPoint &c)
 Check whether a point lies within the circumcircle of a given triangle. More...
 

Function Documentation

◆ angle() [1/2]

template<typename T >
T til::geo::angle ( x,
y,
norm 
)
inline

Returns the angle between (x,y) and the x-axis, with the norm of (x,y) provided.

NB: this version is clearly intended for fast computation and thus no checking on norm is done: in particular, you have to check yourself that the norm is not too small.

Referenced by til::myComplexPow(), til::MeshWaveletEnergy< TVertexCollection, TNeighborhoods, TPrec >::operator()(), and til::simple_delaunay_triangulation().

◆ angle() [2/2]

template<typename T >
T til::geo::angle ( x,
y 
)
inline

Returns the angle between (x,y) and the x-axis.

◆ cartesian2spherical()

template<typename T >
void til::geo::cartesian2spherical ( x,
y,
z,
T &  theta,
T &  phi,
T &  rho 
)

Converts cartesian coordinates into spherical coordinates.

◆ herons_formula() [1/2]

template<typename T >
T til::geo::herons_formula ( a,
b,
c 
)
inline

Heron's formula.

The Heron's formula yields the surface of a triangle given the length of its edges.

◆ herons_formula() [2/2]

template<typename T >
T til::geo::herons_formula ( numeric_array< T, 3 > const &  lengths)
inline

Heron's formula.

The Heron's formula yields the surface of a triangle given the length of its edges.

◆ is_in_circumcircle()

template<typename TPrec , typename TPoint >
bool til::geo::is_in_circumcircle ( const TPoint &  p,
const TPoint &  a,
const TPoint &  b,
const TPoint &  c 
)
inline

Check whether a point lies within the circumcircle of a given triangle.

Parameters
pa point
afirst triangle vertex
bsecond triangle vertex
cthird triangle vertex

Definition at line 750 of file geometrics.h.

Referenced by til::geo::AreIntersecting::Triangles3D< TArray >::operator()().

◆ law_of_cosines()

template<typename T >
T til::geo::law_of_cosines ( a,
b,
c 
)
inline

Returns the cosine of angle A given the lengths of the triangle edges.

◆ law_of_tangents() [1/2]

template<typename T >
T til::geo::law_of_tangents ( a,
b,
c,
area 
)
inline

Returns the tangent of angle A given the area and the lengths of the edges of the triangle.

◆ law_of_tangents() [2/2]

template<typename T >
T til::geo::law_of_tangents ( a,
b,
c 
)
inline

Returns the tangent of angle A given the lengths of the edges of the triangle.

◆ spherical2cartesian()

template<typename T >
void til::geo::spherical2cartesian ( theta,
phi,
rho,
T &  x,
T &  y,
T &  z 
)
inline

Converts spherical coordinates into cartesian coordinates.

◆ triangle2segment()

template<typename TArray >
bool til::geo::triangle2segment ( const TArray &  A,
const TArray &  B,
const TArray &  C,
TArray &  X,
TArray &  Y 
)

◆ triangle_normal()

template<typename TArray , typename TResArray >
bool til::geo::triangle_normal ( const TArray &  A,
const TArray &  B,
const TArray &  C,
TResArray &  result 
)