RM0440
The primary argument is the x coordinate, that is, the magnitude of the vector in the
direction of the x axis. If |x| > 1, a scaling must be applied in software to adapt it to the q1.31
range of ARG1.
The secondary argument is the y coordinate, that is, the magnitude of the vector in the
direction of the y axis. If |y| > 1, a scaling must be applied in software to adapt it to the q1.31
range of ARG2.
The primary result, RES1, is the modulus, given by:
RES1 will be saturated to 1.
The secondary result, RES2, is the phase angle θ of the vector v. RES2 must be multiplied
by π to obtain the angle in radians. Note that values close to π may sometimes wrap to -π
due to the circular nature of the phase angle.
Arctangent
Parameter
ARG1
ARG2
RES1
RES2
SCALE
This function calculates the arctangent, or inverse tangent, of the input argument x.
The primary argument, ARG1, is the input value, x = tan θ. If |x| > 1, a scaling factor of 2
must be applied in software such that -1 < x · 2
in ARG1 and the scale factor n must be programmed in the SCALE parameter.
Note that the maximum input value allowed is tan θ = 128, which corresponds to an angle
θ = 89.55 degrees. For |x| > 128, a software method must be used to find tan
The secondary argument, ARG2, is unused.
The primary result, RES1, is the angle θ = tan
obtain the angle in radians.
The secondary result, RES2, is unused.
Table 96. Arctangent parameters
n
–
⋅
x
2
Not applicable
-n
-1
2
· tan
x, in radians, divided by p
Not applicable
n
RM0440 Rev 1
CORDIC co-processor (CORDIC)
2
v
=
x
+
y
Description
-n
< 1. The scaled value x · 2
-1
x. RES1 must be multiplied by 2
2
. If |v| > 1 the result in
Range
[-1, 1]
-
[-1, 1]
-
[0 7]
-n
is programmed
-1
x.
n
· π to
429/2083
-n
445
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?