15 #ifndef __IPSDKMATH_ANGLES2D_H__ 16 #define __IPSDKMATH_ANGLES2D_H__ 33 template <
typename TOut,
typename TIn>
34 IPSDK_FORCEINLINE TOut
37 return round<TOut>(rho * cosTheta);
39 template <
typename TOut,
typename TIn>
40 IPSDK_FORCEINLINE TOut
43 return round<TOut>(rho * sinTheta);
45 template <
typename TOut,
typename TIn>
46 IPSDK_FORCEINLINE
void 50 x = polarToXCartesian<TOut>(rho, cosTheta, sinTheta);
51 y = polarToYCartesian<TOut>(rho, cosTheta,sinTheta);
53 template <
typename TOut,
typename TIn>
54 IPSDK_FORCEINLINE
void 65 template <
typename TOut,
typename TIn>
66 IPSDK_FORCEINLINE
void 68 TOut& rho, TOut& theta)
70 rho = round<TOut>(
normL2(x, y));
71 theta = std::atan2(y, x);
79 IPSDK_FORCEINLINE
void 84 rxx = cosTheta; rxy = -sinTheta;
85 ryx = sinTheta; ryy = cosTheta;
88 IPSDK_FORCEINLINE
void 102 matRot(0, 0), matRot(0, 1),
103 matRot(1, 0), matRot(1, 1));
113 template <
typename T>
114 IPSDK_FORCEINLINE
void 118 theta = std::atan2(-rxy, rxx);
122 template <
typename T>
123 IPSDK_FORCEINLINE
void 125 const T ryx,
const T ryy,
145 template <
typename T>
146 IPSDK_FORCEINLINE
void 151 xOut = round<T>(cosTheta * xIn - sinTheta * yIn);
152 yOut = round<T>(sinTheta * xIn + cosTheta * yIn);
154 template <
typename T>
155 IPSDK_FORCEINLINE
void 163 template <
typename T>
164 IPSDK_FORCEINLINE
void 170 std::cos(theta), std::sin(theta),
181 #endif // __IPSDKMATH_ANGLES2D_H__ IPSDK_FORCEINLINE void rotate2d(const T xIn, const T yIn, const ipReal64 cosTheta, const ipReal64 sinTheta, T &xOut, T &yOut)
rotation of a point using a rotation angle (rotation around origin)
Definition: Angles2d.h:147
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
IPSDK_FORCEINLINE void angleToMatrix(const T cosTheta, const T sinTheta, T &rxx, T &rxy, T &ryx, T &ryy)
Convertion from angle to rotation matrix.
Definition: Angles2d.h:80
Predefined types for linear algebra management.
IPSDK_FORCEINLINE void cartesianToPolar(const TIn x, const TIn y, TOut &rho, TOut &theta)
cartesian to polar convertion
Definition: Angles2d.h:67
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
IPSDK_FORCEINLINE TOut polarToYCartesian(const TIn rho, const TIn cosTheta, const TIn sinTheta)
polar to cartesian convertion
Definition: Angles2d.h:41
IPSDK_FORCEINLINE void polarToCartesian(const TIn rho, const TIn cosTheta, const TIn sinTheta, TOut &x, TOut &y)
polar to cartesian convertion
Definition: Angles2d.h:47
Utility functions used to handle points 2d.
IPSDK_FORCEINLINE TOut polarToXCartesian(const TIn rho, const TIn cosTheta, const TIn sinTheta)
polar to cartesian convertion
Definition: Angles2d.h:35
Utility functions for angle management.
Utility functions for ipsdk math library.
IPSDK_FORCEINLINE void matrixToAngle(const T rxx, const T rxy, T &theta)
Convertion from rotation matrix to angle.
Definition: Angles2d.h:115
boost::numeric::ublas::bounded_matrix< ipReal64, 2, 2 > Matrix2d
2d matrix (2x2) type associated to library
Definition: LinearAlgebraTypes.h:51
IPSDK_FORCEINLINE void rotate2dInSitu(const ipReal64 cosTheta, const ipReal64 sinTheta, T &x, T &y)
rotation of a point using a rotation angle (rotation around origin)
Definition: Angles2d.h:156
IPSDK_FORCEINLINE ipReal64 normL2(const T x, const T y)
L2 norm of a 2d vector.
Definition: Vector2d.h:32