# shz::sincos

Source: https://sh4zam.com/api/cpp/sincos/

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](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_trig.hpp#L44))
- **C type:** [`shz_sincos_t`](https://sh4zam.com/api/trig/shz_sincos_t/) (layout-compatible; the C API accepts it directly)
- **Bases:** `shz_sincos_t`

## Static functions

### from_radians

```cpp
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()`](https://sh4zam.com/api/trig/shz_sincosf/), [`shz_sincosu16()`](https://sh4zam.com/api/trig/shz_sincosu16/)

### from_degrees

```cpp
static sincos from_degrees(float deg) noexcept
```

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

Calls: [`shz_sincosf_deg()`](https://sh4zam.com/api/trig/shz_sincosf_deg/)

## Members

### sincos

```cpp
sincos(const shz_sincos_t &val) noexcept
```

Converting constructor from C struct.

### sinf

```cpp
float sinf() const noexcept
```

Returns the sine component from the pair.

### cosf

```cpp
float cosf() const noexcept
```

Returns the cosine component from the pair.

### tanf

```cpp
float tanf() const noexcept
```

Calculates the tangent from the given pair.

Calls: [`shz_sincos_tanf()`](https://sh4zam.com/api/trig/shz_sincos_tanf/)

### secf

```cpp
float secf() const noexcept
```

Calculates the secant from the given pair.

Calls: [`shz_sincos_secf()`](https://sh4zam.com/api/trig/shz_sincos_secf/)

### cscf

```cpp
float cscf() const noexcept
```

Calculates the cosecant from the given pair.

Calls: [`shz_sincos_cscf()`](https://sh4zam.com/api/trig/shz_sincos_cscf/)

### cotf

```cpp
float cotf() const noexcept
```

Calculates the cotangent from the given pair.

Calls: [`shz_sincos_cotf()`](https://sh4zam.com/api/trig/shz_sincos_cotf/)

### operator std::pair< float, float >

```cpp
operator std::pair< float, float >() const noexcept
```

### cos

```cpp
float shz_sincos_t::cos
```

cosf() approximation for the angle

Inherited from `shz::vecN`.

### sin

```cpp
float shz_sincos_t::sin
```

sinf() approximation for the angle

Inherited from `shz::vecN`.
