Vector.SinCos Method

Overload List

#SignatureDescription
1procedure SinCos(SinX: TMtxVec; CosX: TMtxVec);Sine and cosine.
2procedure SinCos(SinX: TMtxVec; CosX: TMtxVec; SinXIndex: Integer; CosXIndex: Integer; Index: Integer; Len: Integer);Calculates the sine and cosine for calling object elements [Index]..[Index+Len-1].

Overload 1: procedure SinCos(SinX: TMtxVec; CosX: TMtxVec);

Sine and cosine.

#NameTypeDescription
1SinXTMtxVecsource TVec or TMtx
2CosXTMtxVecsource TVec or TMtx

Result: stored in self (calling object)

Remarks:

Calculates the sine and cosine for all calling object elements and stores the sines to SinX and cosines to CosX. Size and Vector.Complex property of SinX and CosX are adjusted automatically.

Note
Use this method if you require both sine and cosine.

Examples
var a,s,c: Vector;
begin
    a.SetIt(false[0,PIDIV2,PI]);
    a.Sincos(s,c); // s=[0,1,0], c =[1,0,-1]
end;
See Also: Vector.Sin, Vector.Cos

Overload 2: procedure SinCos(SinX: TMtxVec; CosX: TMtxVec; SinXIndex: Integer; CosXIndex: Integer; Index: Integer; Len: Integer);

Calculates the sine and cosine for calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1SinXTMtxVecsource TVec or TMtx
2CosXTMtxVecsource TVec or TMtx
3SinXIndexInteger
4CosXIndexInteger
5IndexIntegerstart index
6LenIntegerelement count

Result: stored in self (calling object)

Remarks:

Stores the sines to SinX elements [SinXIndex]..[SinXIndex+Len-1] and cosines to CosX elements [CosXIndex]..[CosXIndex+Len-1] elements. Size and Vector.Complex property of SinX and CosX objects are not set automatically. An exception is raised if Vector.ConditionCheck and array borders are overrun/underun.