Skip to content

shz::sincos

Markdown

C++ sine/cosine approximation pairs.

This structure contains the precomputed values for both sine and cosine of an angle.

  • Header: #include <sh4zam/shz_trig.hpp> (source)
  • C type: shz_sincos_t (layout-compatible; the C API accepts it directly)
  • Bases: shz_sincos_t
static sincos from_radians(float rad) noexcept
static sincos from_radians(uint16_t rad) noexcept

Returns a new sin/cos pair from the given angle in radians.

Calls: shz_sincosf(), shz_sincosu16()

static sincos from_degrees(float deg) noexcept

Returns a new sin/cos pair from the given angle in degrees.

Calls: shz_sincosf_deg()

sincos(const shz_sincos_t &val) noexcept

Converting constructor from C struct.

float sinf() const noexcept

Returns the sine component from the pair.

float cosf() const noexcept

Returns the cosine component from the pair.

float tanf() const noexcept

Calculates the tangent from the given pair.

Calls: shz_sincos_tanf()

float secf() const noexcept

Calculates the secant from the given pair.

Calls: shz_sincos_secf()

float cscf() const noexcept

Calculates the cosecant from the given pair.

Calls: shz_sincos_cscf()

float cotf() const noexcept

Calculates the cotangent from the given pair.

Calls: shz_sincos_cotf()

operator std::pair< float, float >() const noexcept
float shz_sincos_t::cos

cosf() approximation for the angle

Inherited from shz::vecN.

float shz_sincos_t::sin

sinf() approximation for the angle

Inherited from shz::vecN.