2
3
4
5
6
7
8
9
10
11
19
20
21
22
23
24
27#define SHZ_F_PI 3.14159265359f
35#define SHZ_FSCA_RAD_FACTOR 10430.37835f
37#define SHZ_FSCA_DEG_FACTOR 182.04444443f
39#define SHZ_FSCA_ERROR_MAX 4.76837158e-7
42#define SHZ_DEG_TO_RAD(deg) ((deg) * SHZ_F_PI / 180.0f
)
44#define SHZ_RAD_TO_DEG(rad) ((rad) * 180.0f
/ SHZ_F_PI)
49
50
51
52
53
54
55
56
66
67
68
74SHZ_INLINE shz_sincos_t
shz_sincosf(
float radians) SHZ_NOEXCEPT;
94
95
96
99SHZ_INLINE
float shz_sinf(
float radians) SHZ_NOEXCEPT;
105SHZ_INLINE
float shz_cosf(
float radians) SHZ_NOEXCEPT;
111SHZ_INLINE
float shz_tanf(
float radians) SHZ_NOEXCEPT;
117SHZ_INLINE
float shz_secf(
float radians) SHZ_NOEXCEPT;
123SHZ_INLINE
float shz_cscf(
float radians) SHZ_NOEXCEPT;
129SHZ_INLINE
float shz_cotf(
float radians) SHZ_NOEXCEPT;
137
138
139
171
172
173
196
197
198
220#include "inline/shz_trig.inl.h"
float shz_atanf(float x) noexcept
Fast arctangent approximation; equvalent to C's atanf().
shz_sincos_t shz_sincosf_deg(float degrees) noexcept
Returns sinf/cosf() pairs for the given floating-point angle in degrees.
float shz_atanhf(float x) noexcept
Fast hyperbolic arctangent function.
float shz_cotf_deg(float degrees) noexcept
One-off routine for returning only cotangent (1 / cot(x)) from an angle in degrees.
float shz_atanf_unit(float x) noexcept
Fast arctangent approximation for unit values between 0.0f and 1.0f.
float shz_acoshf(float x) noexcept
Fast hyperbolic arccosine function.
#define SHZ_F_PI
Single-precision floating-point PI approximation (do not use M_PI!)
shz_sincos_t shz_sincos
Alternate C shz_sincos_t typedef for those who hate POSIX style.
float shz_acosf(float x) noexcept
Fast arccosine approximation; equivalent to C's acosf().
float shz_cscf_deg(float degrees) noexcept
One-off routine for returning only cosecant (1 / sin(x)) from an angle in degrees.
float shz_cosf_deg(float degrees) noexcept
One-off routine for returning only cosf() from an angle in degrees.
shz_sincos_t shz_sincosf(float radians) noexcept
Returns sinf()/cosf() pairs for the given floating-point angle in radians.
float shz_tanf_deg(float degrees) noexcept
One-off routine for returning only tanf() from an angle in degrees.
float shz_cosf(float radians) noexcept
One-off routine for returning only cosf() from an angle in radians.
float shz_acothf(float x) noexcept
Fast hyperbolic arccotangent function.
float shz_sinf_deg(float degrees) noexcept
One-off routine for returning only sinf() from an angle in degrees.
float shz_secf(float radians) noexcept
One-off routine for returning only secant (1 / cos(x)) from an angle in radians.
float shz_tanf(float radians) noexcept
One-off routine for returning only tanf() from an angle in radians.
float shz_sinf(float radians) noexcept
One-off routine for returning only sinf() from an angle in radians.
float shz_coshf(float x) noexcept
Fast hyperbolic cosine function.
shz_sincos_t shz_sincosu16(uint16_t radians16) noexcept
Returns sinf()/cosf() pairs for the given unsigned 16-bit angle in radians.
float shz_cothf(float x) noexcept
Fast hyperbolic cotangent function.
float shz_sincos_cscf(shz_sincos_t sincos) noexcept
Returns the floating-point cosecant (1.0f / sinf(x)) from the given pre-computed sincos pair.
float shz_asechf(float x) noexcept
Fast hyperbolic arcsecant function.
float shz_atan2f(float y, float x) noexcept
Computes arctangent of y / x, using the signs of arguments to determine correct quadtrant....
float shz_asecf(float x) noexcept
Fast arcsecant/inverse secant approximation, taking units in radians.
float shz_secf_deg(float degrees) noexcept
One-off routine for returning only secant (1 / cos(x)) from an angle in degrees.
float shz_acscf(float x) noexcept
Fast arccosecant/inverse cosecant approximation; taking units in radians.
float shz_sincos_secf(shz_sincos_t sincos) noexcept
Returns the floating-point secant (1.0f / cosf(x)) from the given pre-computed sincos pair.
float shz_sincos_tanf(shz_sincos_t sincos) noexcept
Returns tanf() from the given pre-computed sincos pair.
float shz_cscf(float radians) noexcept
One-off routine for returning only cosecant (1 / sin(x)) from an angle in radians.
float shz_asinf(float x) noexcept
Fast arcsine approximation; equivalent to C's asinf().
float shz_cotf(float radians) noexcept
One-off routine for returning only cotangent (1 / tan(x)) from an angle in radians.
float shz_sincos_cotf(shz_sincos_t sincos) noexcept
Returns the floating-point cotangent (1.0f / tanf(x)) from the given pre-computed sincos pair.
float shz_asinhf(float x) noexcept
Fast hyperbolic arcsine function.
float shz_atanf_q1(float x) noexcept
Fast arctangent approximation for values lying within the first quadrant (>= 0.0f).
float shz_tanhf(float x) noexcept
Fast hyperbolic tangent function.
float shz_acschf(float x) noexcept
Fast hyperbolic arccosecant function.
float shz_sechf(float x) noexcept
Fast hyperbolic secant function.
float shz_cschf(float x) noexcept
Fast hyperbolic cosecant function.
float shz_acotf(float x) noexcept
Fast arccotangent/inverse cotangent approximation; taking units in radians.
float shz_sinhf(float x) noexcept
Fast hyperbolic sine function.
Pair representing the sine and cosine of a given angle.
float cos
cosf() approximation for the angle
float sin
sinf() approximation for the angle