### Related

v= (3,2);

atan2 (3,x);

Calculate

##### atan2-imagpart-plot2d-realpart-sin-sqrt

W: imagpart(sqrt(sin(...

W1: realpart(sqrt(sin...

W2: sqrt(sqrt(sin(%pi...

Calculate

##### atan2-cos-num-pi-plot2d

aInitialValue_num: 1.0;

aFinalValue_num: 1.0;

Calculate

##### atan2-cos-imagpart-plot2d-realpart-sin-sqrt

W: realpart(sin(%pi*x...

W1: realpart(sqrt(sin...

WP: imagpart(sqrt(sin...

Calculate

(5/12) / (7/8);

5^1/2;

5^(1/2);

Calculate

##### atan2

atan2(0.5,1.5)+atan2(...

Calculate

##### atan2-collectterms-expand-factor-float-ratsimp-sin-solve-trigexpand

float(atan2(2,3));

expand((x - 1/a - 1/b...

f : x^4 + 4*x^3 - 17*...

Calculate

##### atan2-cos-float-log-plot2d-tan

(-1/0.75) / (-1/-0.75);

5^1/2;

5^(1/2);

Calculate

##### atan2

atan2(-0.94,0.05);

Calculate

##### atan2-num-plot2d-sin

aInitialValue_num: 1.0;

aFinalValue_num: 2.0;

Calculate

### atan2

Run Example
```(%i1)taylor(-2 . atan2(1, sin(t+d)/(cos(t+d)+1))^2 + 2 . atan2(1, sin(t-d)/(cos(t-d)+1))^2, t, 0, 0);
2        sin(d)             2      sin(d)
(%o1)/T/  2 atan2 (1, - ----------) - 2 atan2 (1, ----------) + . . .
cos(d) + 1                cos(d) + 1
(%i2) ```
Run Example
```build_info();

Maxima version: 5.21.1
Maxima build date: 7:25 9/18/2010
Host type: x86_64-unknown-linux-gnu
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.7

(%o1)
(%i2) /* compute angles for intrinsic Tait-Bryan angles * on axes y-z'-x'', conventionally named pitch, yaw, and roll * (following terminology on Wikipedia page for "Euler angles") * via method expounded by G. Slabaugh: * http://www.staff.city.ac.uk/~sbbh653/publications/euler.pdf * * Argument R is a 3x3 rotation matrix. * Return value is a list of two triples, [[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]], * because there are always two solutions. */intrinsic_yzx (R) :=  if equal (R[2, 1], 1) or equal (R[2, 1], -1)    then intrinsic_yzx_yaw_pi2 (R)    else block ([pitch1, pitch2, yaw1, yaw2, roll1, roll2],      yaw1 : asin (R[2, 1]),       yaw2 : %pi - yaw1,      pitch1 : atan2 (-R[3, 1]/cos(yaw1), R[1, 1]/cos(yaw1)),      pitch2 : atan2 (-R[3, 1]/cos(yaw2), R[1, 1]/cos(yaw2)),      roll1 : atan2 (-R[2, 3]/cos(yaw1), R[2, 2]/cos(yaw1)),      roll2 : atan2 (-R[2, 3]/cos(yaw2), R[2, 2]/cos(yaw2)),      [[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]]);
(%o2) intrinsic_yzx(R) := if equal(R    , 1) or equal(R    , - 1)
2, 1               2, 1
then intrinsic_yzx_yaw_pi2(R) else block([pitch1, pitch2, yaw1, yaw2, roll1,
roll2], yaw1 : asin(R    ), yaw2 : %pi - yaw1,
2, 1
- R         R                         - R         R
3, 1      1, 1                        3, 1      1, 1
pitch1 : atan2(---------, ---------), pitch2 : atan2(---------, ---------),
cos(yaw1)  cos(yaw1)                  cos(yaw2)  cos(yaw2)
- R         R                        - R         R
2, 3      2, 2                       2, 3      2, 2
roll1 : atan2(---------, ---------), roll2 : atan2(---------, ---------),
cos(yaw1)  cos(yaw1)                 cos(yaw2)  cos(yaw2)
[[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]])
(%i3) intrinsic_yzx_yaw_pi2 (R) :=  block ([pitch1, pitch2, yaw1, yaw2, roll1, roll2],    yaw1 : %pi/2,    roll1 : 0, /* could be anything */    pitch1 : -roll1 + atan2 (R[3, 2], R[3, 3]),    yaw2 : -%pi/2,    roll2 : 0, /* could be anything */    pitch2 : roll2 + atan2 (R[1, 3], R[1, 2]),    [[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]]);
(%o3) intrinsic_yzx_yaw_pi2(R) := block([pitch1, pitch2, yaw1, yaw2, roll1,
%pi
roll2], yaw1 : ---, roll1 : 0, pitch1 : - roll1 + atan2(R    , R    ),
2                                        3, 2   3, 3
- %pi
yaw2 : -----, roll2 : 0, pitch2 : roll2 + atan2(R    , R    ),
2                                       1, 3   1, 2
[[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]])
(%i4) set_random_state (make_random_state (1));
(%o4)                                done
(%i5) random_3d_unit () := (random_3d (), %%/norm(%%));
%%
(%o5)             random_3d_unit() := (random_3d(), --------)
norm(%%)
(%i6) random_3d () := makelist (random (10), i, 1, 3);
(%o6)            random_3d() := makelist(random(10), i, 1, 3)
(%i7) norm (v) := sqrt (lsum (x^2, x, v));
2
(%o7)                   norm(v) := sqrt(lsum(x , x, v))
(%i8) u : random_3d_unit ();
5          9          4
(%o8)                  [---------, ---------, ---------]
sqrt(122)  sqrt(122)  sqrt(122)
(%i9) v : random_3d_unit ();
8         3         3
(%o9)                   [--------, --------, --------]
sqrt(82)  sqrt(82)  sqrt(82)
(%i10) R(a,b):= block ([v, s, c], v:cross(a,b), s:norm(v), c:dot(a,b), ident(length(a)) + ssc(v) + (ssc(v).ssc(v))*(1 - c)/s^2, ratsimp(%%));
(%o10) R(a, b) := block([v, s, c], v : cross(a, b), s : norm(v),
(ssc(v) . ssc(v)) (1 - c)
c : dot(a, b), ident(length(a)) + ssc(v) + -------------------------,
2
s
ratsimp(%%))
(%i11) cross(a,b) := [a[2]*b[3]-b[2]*a[3], -(a[1]*b[3]-b[1]*a[3]), a[1]*b[2]-b[1]*a[2]];
(%o11) cross(a, b) := [a  b  - b  a , - (a  b  - b  a ), a  b  - b  a ]
2  3    2  3      1  3    1  3    1  2    1  2
(%i12) norm(v):= sqrt(v[1]^2 + v[2]^2 + v[3]^2);
2    2    2
(%o12)                   norm(v) := sqrt(v  + v  + v )
1    2    3
(%i13) dot(a,b):= a[1]*b[1]+a[2]*b[2]+a[3]*b[3];
(%o13)                dot(a, b) := a  b  + a  b  + a  b
1  1    2  2    3  3
(%i14) ssc(v) := matrix ([0, -v[3], v[2]], [v[3], 0, -v[1]], [-v[2], v[1], 0]);
(%o14)   ssc(v) := matrix([0, - v , v ], [v , 0, - v ], [- v , v , 0])
3   2     3        1       2   1
(%i15) Ruv : float (R (u, v));
[  0.80240796270139   0.58412740488141   0.12221553199131  ]
[                                                          ]
(%o15)   [ - 0.5556446634958   0.80598226750272  - 0.20408721762966 ]
[                                                          ]
[ - 0.21771648840189  0.09585280036434   0.97129386456431  ]
(%i16) intrinsic_yzx (Ruv);

rat: replaced -1.5556446634958 by -7758/4987 = -1.55564467615801

rat: replaced 0.4443553365042 by 4987/11223 = 0.44435534170899
(%o16) [[0.26495004690786, - 0.58913814199809, 0.24800273610235],
[- 2.876642606681936, %pi + 0.58913814199809, - 2.89358991748744]]
(%i17) ```
Run Example
```jacobian(atan2(-sin(th)*(lx - x) + cos(th)*(ly -y),cos(th)*(lx - x) + sin(th)*(ly -y)), [x, y, th]);
(%o1) jacobian(atan2(cos(th) (ly - y) - sin(th) (lx - x),
sin(th) (ly - y) + cos(th) (lx - x)), [x, y, th])
(%i2) ```

Help for Atan2