clVector.FixAngle Method

Overload List

#SignatureDescription
1function FixAngle: TOpenCLMtxVec;Sets angle in [-2PI,2PI].
└ indexed: function FixAngle(Index: Integer; Len: Integer): TOpenCLMtxVec;
2function FixAngle(const Src: TOpenCLMtxVec): TOpenCLMtxVec;Sets angle in [-2PI,2PI] for all Src elements.
└ indexed: function FixAngle(const Src: TOpenCLMtxVec; SrcIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

Overload 1: function FixAngle: TOpenCLMtxVec;

Sets angle in [-2PI,2PI].

Result: stored in self (calling object), returns self for chaining

Returns: ThetaRad within -2Math387.PI and Math387.PI interval.

Remarks:

Calling this function prior to passing the value to trigonometric functions can significantly improve numerical accuracy.

Sine/cosine appear within many other functions especially complex versions of trigonometric functions. FixAngle method is not used implicitely within TOpenCLMtxVec methods. To achieve maximum performance make sure that the arguments passed to complex trigonometric functions are "small" or scaled down.

Note
The vector must be real.

Indexed: function FixAngle(Index: Integer; Len: Integer): TOpenCLMtxVec;

FixAngle for calling object complex elements [Index]..[Index+Len-1] in-place.

#NameTypeDescription
1IndexIntegerstart index
2LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

An exception is raised if calling object clVector.Complex property is True or if array borders are overrun/underrun.

Overload 2: function FixAngle(const Src: TOpenCLMtxVec): TOpenCLMtxVec;

Sets angle in [-2PI,2PI] for all Src elements.

#NameTypeDescription
1SrcTOpenCLMtxVec

Result: stored in self (calling object), returns self for chaining

Remarks:

Stores the results in the calling object. Size and clVector.Complex properties of the calling vector are set implicitly to match the Src object.

Indexed: function FixAngle(const Src: TOpenCLMtxVec; SrcIndex: Integer; Index: Integer; Len: Integer): TOpenCLMtxVec;

Sets angle in [-2PI,2PI] for Src elements [SrcIndex]..[SrcIndex+Len-1] and store the results in the calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1SrcTOpenCLMtxVec
2SrcIndexIntegersource start index
3IndexIntegerstart index
4LenIntegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

Size and clVector.Complex properties of the calling object must be set explicitly. An exception is raised if array borders are overrun.