| Syntax C/C++ | #include <VFmath.h>
int VF_sincos( fVector YSin, fVector YCos, fVector X, ui size );
int VFx_sincos( fVector YSin, fVector YCos, fVector X, ui size, float A, float B, float C );
int VFr_sincos( fVector YSin, fVector YCos, fVector X, ui size );
int VFrx_sincos( fVector YSin, fVector YCos, fVector X, ui size, float A, float B, float C ); |
| C++ VecObj | #include <OptiVec.h>
int vector<T>::sincos( vector<T> YCos, const vector<T>& X );
int vector<T>::x_sincos( vector<T> YCos, const vector<T>& X, const T& A, const T& B, const T& C );
int vector<T>::r_sincos( vector<T> YCos, const vector<T>& X );
int vector<T>::rx_sincos( vector<T> YCos, const vector<T>& X, const T& A, const T& B, const T& C ); |
| Pascal/Delphi | uses VFmath;
function VF_sincos( Sin, Cos, X:fVector; size:UInt ): IntBool;
function VFx_sincos( Sin, Cos, X:fVector; size:UInt; A, B, C:Single ): IntBool;
function VFr_sincos( Sin, Cos, X:fVector; size:UInt ): IntBool;
function VFrx_sincos( Sin, Cos, X:fVector; size:UInt; A, B, C:Single ): IntBool; |
|
| Description | normal versions:
YSini = sin( Xi )
YCosi = cos( Xi )
expanded versions:
YSini = C * sin( A*Xi+B )
YCosi = C * cos( A*Xi+B )
The sine and the cosine are calculated simultaneously, which is far more efficient than calculating them separately if both of them are needed. For large values of Xi, round-off error becomes appreciable; if the Xi values are representable as fractional multiples of p, it is better to use VF_sincosrpi than VF_sincos.
If, on the other hand, one can be sure that all Xi are within the range -2p <= Xi <= +2p, one can employ the faster reduced-range versions with the prefixes VFr_ and VFrx_. |
|