p (OptiVec vector function)">p">
VF_cosrpiVD_cosrpiVE_cosrpi
VF_cosrpi2VD_cosrpi2VE_cosrpi2
VF_cosrpi3VD_cosrpi3VE_cosrpi3
FunctionCosine function of fractional multiples of p
Syntax C/C++#include <VFmath.h>
int VF_cosrpi( fVector Y, iVector P, ui size, int q );
int VF_cosrpi2( fVector Y, iVector P, ui size, int q );
int VF_cosrpi3( fVector Y, iVector P, ui size, int q );
C++ VecObj#include <OptiVec.h>
int vector<T>::cosrpi( const vector<int>& P, int q );
int vector<T>::cosrpi2( const vector<int>& P, int q );
int vector<T>::cosrpi3( const vector<int>& P, int q );
Pascal/Delphiuses VFmath;
function VF_cosrpi( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cosrpi2( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
function VF_cosrpi3( Y:fVector; P:iVector; size:UIntSize; q:Integer ): IntBool;
DescriptionYi = cos( (Pi / q) * p )
The cosine of fractional multiples of p is calculated. There are three versions: VF_cosrpi is for general use with any arbitrary denominator q. If q is a power of 2, VF_cosrpi2 should be used which is a highly optimized version reading the results from a look-up table, if possible. If q is a multiple of 3, VF_cosrpi3 should be used. VF_cosrpi3 offers a convenient way to use degrees instead of radians; if, for example, q is 180, the unit of the elements of P is "degree". VF_cosrpi2 and VF_cosrpi3 work also with q values they are not optimized for; in this case, however, memory space is wasted for the tables.
Error handlingThese functions are error-proof, as long as q != 0.
Return valuealways FALSE (0)
See alsoVF_cos,   cos

VectorLib Table of Contents  OptiVec home