You are here: Symbol Reference > AbstractMtxVec Namespace > Classes > TMtxVec Class > public > FixAngle Method > TMtxVec.FixAngle Method ()
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtxVec.FixAngle Method ()

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

Pascal
function FixAngle: TMtxVec; overload;

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

Calling this function prior to passing the value to trigonometric functions can significantly improve numerical accuracy. For arguments larger than 10000, the computation of sine/cosine is speeded up by about 10x for SSE2/SSE3. The performance gains for classic FPU math are also significant. The cost of this function call is approx 30% of the cost of the sine function. 

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

The vector must be real.

Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!