Matrix::SinCos Method

Overload List

#SignatureDescription
1void SinCos(TMtxVec *SinX, TMtxVec *CosX) const;Sine and cosine.
2void SinCos(TMtxVec *SinX, TMtxVec *CosX, int SinXIndex, int CosXIndex, int Index, int Len) const;Calculates the sine and cosine for calling object elements [Index]..[Index+Len-1].

Overload 1: void SinCos(TMtxVec *SinX, TMtxVec *CosX) const;

Sine and cosine.

#NameTypeDescription
1SinXTMtxVec *
2CosXTMtxVec *
Remarks:

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

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

Examples
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix a, s, c;

    a.SetIt(1, 3, false, DewArray<double>{0, PIDIV2, PI});
    a.SinCos(s, c); // s=[0,1,0], c =[1,0,-1]
}
See Also: Matrix::Sin, Matrix::Cos
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler

Overload 2: void SinCos(TMtxVec *SinX, TMtxVec *CosX, int SinXIndex, int CosXIndex, int Index, int Len) const;

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

#NameTypeDescription
1SinXTMtxVec *
2CosXTMtxVec *
3SinXIndexint
4CosXIndexint
5Indexint
6Lenint
Remarks:

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

Examples
#include "Math387.h"
#include "MtxExpr.h"

using namespace Dew;
using namespace Dew::Math;

void Example()
{
    Matrix a, s, c;

    a = {{0, PIDIV2, PI}};
    a.SinCos(s, c); // s=[0,1,0], c =[1,0,-1]
}
Declared in Dew::Math::Matrix · Dew.Math/MtxExpr.h · Cross-compiler