SinCosOne

Computes the sine and cosine of an angle.

Syntax

Intel IPP style:

IppStatus ippsqSinCosOne_32f(const Ipp32f* pX, Ipp32f* pSin, Ipp32f* pCos);IppStatus ippsqSinCosOneQ31_32s(const Ipp32s* pX, Ipp32s* pSin, Ipp32s* pCos);

DSP style:

void ippsq_sin_cos_f32(const float32_t X, float32_t* pSin, float32_t* pCos);

void ippsq_sin_cos_q31(q31_t theta, q31_t* pSin, q31_t* pCos);

Include Files

ippsq.h

dsp.h

Parameters

pX

Pointer to the source value (for Intel IPP style).

X, theta

Source value (for DSP style).

pSin

Pointer to the sine result.

pCos

Pointer to the cosine result.

Description

This function computes the sine and cosine of the source value and stores the result in pSin and pCos, respectively. In floating point flavors, the input value X is in degrees. The Q31 flavors support the source value in degrees scaled in range [-1, +1), which is mapped to [-180, 180).

The following table lists functions' arguments and return values:

F32 src 30° 60° 90° 180°
F32 sin 0 0.5 0.866025388 1 0
F32 cos 1 0.866025388 0.5 0 -1
Q31 src 0 0x15555555 0x2aaaaaaa 0x40000000 0x7fffffff
Q31 sin 0 0x3ffffffc 0x6ed9eba0 0x7ffffffc 0
Q31 cos 0 0x6ed9eba0 0x40000000 0 0x80000000

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
For more complete information about compiler optimizations, see our Optimization Notice.