16#ifndef MATHUTILS_INCLUDE_MATHUTILS_DETAIL_TRIGONOMETRIC_H_
17#define MATHUTILS_INCLUDE_MATHUTILS_DETAIL_TRIGONOMETRIC_H_
19#ifndef GPUCA_GPUCODE_DEVICE
113template <
typename T,
typename S,
typename U>
116 return o2::gpu::GPUCommonMath::SinCos(ang,
s,
c);
122 return o2::gpu::GPUCommonMath::SinCos(ang,
s,
c);
127 return o2::gpu::GPUCommonMath::SinCosd(ang,
s,
c);
131#ifndef GPUCA_GPUCODE_DEVICE
138 sincos<T>(ang, sin, cos);
139 return std::make_tuple(sin, cos);
163 sincos<T>(
alpha, sin, cos);
165 xy[0] =
x * cos - xy[1] * sin;
166 xy[1] =
x * sin + xy[1] * cos;
185template <
typename T =
float>
186GPUhdi() constexpr
T sectorDAlpha()
215 return sector2Angle<T>(angle2Sector<T>(
phi));
222 const T dphi =
phi - phiMin;
230 const T dphi =
phi - phiMax;
239 if (!okForPhiMin(phi0,
phi1)) {
258 if (!okForPhiMin(phi0,
phi1)) {
277 constexpr T Pi = 3.1415926535897932384626433832795;
283 constexpr T A = 0.0776509570923569;
284 constexpr T B = -0.287434475393028;
285 constexpr T C = (Pi / 4 -
A -
B);
287 return ((
A * a2 +
B) * a2 + C) *
a;
292 constexpr T Pi025 = 1 * Pi / 4;
293 constexpr T Pi075 = 3 * Pi / 4;
294 const T x1 = xx + yy;
295 const T y1 = yy - xx;
305 return phi0 +
atan(tan);
315 return o2::gpu::GPUCommonMath::ASin(
x);
321 return o2::gpu::GPUCommonMath::ACos(
x);
327 return o2::gpu::GPUCommonMath::ATan(
x);
333 return o2::gpu::GPUCommonMath::ATan2(
y,
x);
339 return o2::gpu::GPUCommonMath::Sin(
x);
345 return o2::gpu::GPUCommonMath::Cos(
x);
351 return o2::gpu::GPUCommonMath::Tan(
x);
357 return o2::gpu::GPUCommonMath::TwoPi();
369 return o2::gpu::GPUCommonMath::Pi();
378#ifndef GPUCA_GPUCODE_DEVICE
392 return std::atan2(
y,
x);
GLfloat GLfloat GLfloat alpha
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean GLboolean GLboolean a
constexpr float SectorSpanDeg
constexpr float SectorSpanRad
void bringTo02PiGen(T &phi)
return((dphi > 0 &&dphi< constants::math::PI)||dphi< -constants::math::PI) ? true GPUhdi() const expr bool okForPhiMax(T phiMax
return((dphi< 0 &&dphi > -constants::math::PI)||dphi > constants::math::PI) ? true T phi1
void bringToPMPiGen(T &phi)
std::tuple< T, T > rotateZ(T xL, T yL, T snAlp, T csAlp)
return copysign< T >(atan2P(o2::gpu::GPUCommonMath::Abs(y), x), y)
float angle2Alpha(float phi)
int angle2Sector(float phi)
std::tuple< float, float > rotateZInv(float xG, float yG, float snAlp, float csAlp)
float sector2Angle(int sect)
void bringToPMPi(float &phi)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.