2
3
4
5
6
7
8
9
10
11
19
20
21
22
23
24
27#define SHZ_F_PI 3.1415926f
33#define SHZ_FSCA_RAD_FACTOR 10430.37835f
35#define SHZ_FSCA_DEG_FACTOR 182.04444443f
37#define SHZ_FSCA_ERROR_MAX 4.76837158e-7
40#define SHZ_DEG_TO_RAD(deg) ((deg) * SHZ_F_PI / 180.0f
)
42#define SHZ_RAD_TO_DEG(rad) ((rad) * 180.0f
/ SHZ_F_PI)
47
48
49
50
51
52
53
54
64
65
66
69SHZ_FORCE_INLINE shz_sincos_t
shz_sincosu16(uint16_t radians16) SHZ_NOEXCEPT;
72SHZ_FORCE_INLINE shz_sincos_t
shz_sincosf(
float radians) SHZ_NOEXCEPT;
92
93
94
97SHZ_FORCE_INLINE
float shz_sinf(
float radians) SHZ_NOEXCEPT;
103SHZ_FORCE_INLINE
float shz_cosf(
float radians) SHZ_NOEXCEPT;
109SHZ_FORCE_INLINE
float shz_tanf(
float radians) SHZ_NOEXCEPT;
115SHZ_FORCE_INLINE
float shz_secf(
float radians) SHZ_NOEXCEPT;
121SHZ_FORCE_INLINE
float shz_cscf(
float radians) SHZ_NOEXCEPT;
127SHZ_FORCE_INLINE
float shz_cotf(
float radians) SHZ_NOEXCEPT;
135
136
137
169
170
171
194
195
196
218#include "inline/shz_trig.inl.h"
float shz_cscf(float radians) SHZ_NOEXCEPT
One-off routine for returning only cosecant (1 / sin(x)) from an angle in radians.
float shz_acotf(float x) SHZ_NOEXCEPT
Fast arccotangent/inverse cotangent approximation; taking units in radians.
float shz_cothf(float x) SHZ_NOEXCEPT
Fast hyperbolic cotangent function.
float shz_tanf(float radians) SHZ_NOEXCEPT
One-off routine for returning only tanf() from an angle in radians.
#define SHZ_F_PI
Single-precision floating-point PI approximation (do not use M_PI!)
float shz_cosf_deg(float degrees) SHZ_NOEXCEPT
One-off routine for returning only cosf() from an angle in degrees.
float shz_acosf(float x) SHZ_NOEXCEPT
Fast arccosine approximation; equivalent to C's acosf().
float shz_sincos_secf(shz_sincos_t sincos) SHZ_NOEXCEPT
Returns the floating-point secant (1.0f / cosf(x)) from the given pre-computed sincos pair.
shz_sincos_t shz_sincos
Alternate C shz_sincos_t typedef for those who hate POSIX style.
float shz_sincos_cotf(shz_sincos_t sincos) SHZ_NOEXCEPT
Returns the floating-point cotangent (1.0f / tanf(x)) from the given pre-computed sincos pair.
shz_sincos_t shz_sincosu16(uint16_t radians16) SHZ_NOEXCEPT
Returns sinf()/cosf() pairs for the given unsigned 16-bit angle in radians.
float shz_acothf(float x) SHZ_NOEXCEPT
Fast hyperbolic arccotangent function.
float shz_cschf(float x) SHZ_NOEXCEPT
Fast hyperbolic cosecant function.
float shz_tanf_deg(float degrees) SHZ_NOEXCEPT
One-off routine for returning only tanf() from an angle in degrees.
float shz_atanf(float x) SHZ_NOEXCEPT
Fast arctangent approximation; equvalent to C's atanf().
float shz_atanf_unit(float x) SHZ_NOEXCEPT
Fast arctangent approximation for unit values between 0.0f and 1.0f.
float shz_secf(float radians) SHZ_NOEXCEPT
One-off routine for returning only secant (1 / cos(x)) from an angle in radians.
float shz_coshf(float x) SHZ_NOEXCEPT
Fast hyperbolic cosine function.
float shz_acoshf(float x) SHZ_NOEXCEPT
Fast hyperbolic arccosine function.
shz_sincos_t shz_sincosf_deg(float degrees) SHZ_NOEXCEPT
Returns sinf/cosf() pairs for the given floating-point angle in degrees.
shz_sincos_t shz_sincosf(float radians) SHZ_NOEXCEPT
Returns sinf()/cosf() pairs for the given floating-point angle in radians.
float shz_cosf(float radians) SHZ_NOEXCEPT
One-off routine for returning only cosf() from an angle in radians.
float shz_sincos_cscf(shz_sincos_t sincos) SHZ_NOEXCEPT
Returns the floating-point cosecant (1.0f / sinf(x)) from the given pre-computed sincos pair.
float shz_sinf(float radians) SHZ_NOEXCEPT
One-off routine for returning only sinf() from an angle in radians.
float shz_sechf(float x) SHZ_NOEXCEPT
Fast hyperbolic secant function.
float shz_cotf(float radians) SHZ_NOEXCEPT
One-off routine for returning only cotangent (1 / tan(x)) from an angle in radians.
float shz_cotf_deg(float degrees) SHZ_NOEXCEPT
One-off routine for returning only cotangent (1 / cot(x)) from an angle in degrees.
float shz_acscf(float x) SHZ_NOEXCEPT
Fast arccosecant/inverse cosecant approximation; taking units in radians.
float shz_asechf(float x) SHZ_NOEXCEPT
Fast hyperbolic arcsecant function.
float shz_atanhf(float x) SHZ_NOEXCEPT
Fast hyperbolic arctangent function.
float shz_asinf(float x) SHZ_NOEXCEPT
Fast arcsine approximation; equivalent to C's asinf().
float shz_cscf_deg(float degrees) SHZ_NOEXCEPT
One-off routine for returning only cosecant (1 / sin(x)) from an angle in degrees.
float shz_asecf(float x) SHZ_NOEXCEPT
Fast arcsecant/inverse secant approximation, taking units in radians.
float shz_atan2f(float y, float x) SHZ_NOEXCEPT
Computes arctangent of y / x, using the signs of arguments to determine correct quadtrant....
float shz_secf_deg(float degrees) SHZ_NOEXCEPT
One-off routine for returning only secant (1 / cos(x)) from an angle in degrees.
float shz_sinf_deg(float degrees) SHZ_NOEXCEPT
One-off routine for returning only sinf() from an angle in degrees.
float shz_asinhf(float x) SHZ_NOEXCEPT
Fast hyperbolic arcsine function.
float shz_sinhf(float x) SHZ_NOEXCEPT
Fast hyperbolic sine function.
float shz_tanhf(float x) SHZ_NOEXCEPT
Fast hyperbolic tangent function.
float shz_atanf_q1(float x) SHZ_NOEXCEPT
Fast arctangent approximation for values lying within the first quadrant (>= 0.0f).
float shz_sincos_tanf(shz_sincos_t sincos) SHZ_NOEXCEPT
Returns tanf() from the given pre-computed sincos pair.
float shz_acschf(float x) SHZ_NOEXCEPT
Fast hyperbolic arccosecant 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