Sponsored links: Algebra eBooks
 

Related

atan2

v= (3,2);

atan2 (0,1);

Calculate

atan2-cos-num-plot2d
plot2d(aInitialValue_num + aCurrentTime_num * atan2(aFinalValue_num - aInitialValue_num, aDuration_num) + lMaxNormalizedDeviation_num * 0.5 * (1 - cos(aCurrentTime_num^slow / aDuration_num^(slow) * %pi*2)),[aCurrentTime_num,0,aDuration_num]);

aInitialValue_num: 1.0;

aFinalValue_num: 1.0;

aDuration_num: 4.0;

Calculate

atan2-cos-imagpart-plot2d-realpart-sin-sqrt
 plot2d([WW],[x,2,15], [y, -5,5]);

W: imagpart(sqrt(sin(...

W1: realpart(sqrt(sin...

WP: imagpart(sqrt(sin...

Calculate

atan2-cos-num-pi-plot2d
plot2d(1-cos(aCurrentTime_num / aDuration_num * 2 * %pi), [aCurrentTime_num,0,aDuration_num]);

aInitialValue_num: 1.0;

aFinalValue_num: 1.0;

aDuration_num: 4.0;

Calculate

atan2-num-plot2d
plot2d((aCurrentTime_num * atan2(aFinalValue_num - aInitialValue_num, aDuration_num) + aInitialValue_num),[aCurrentTime_num,0,aDuration_num]);

aInitialValue_num: 1.0;

aFinalValue_num: 2.0;

aDuration_num: 4.0;

Calculate

atan2-plot2d
plot2d(atan2(x,2),[x,-5,5]);

plot2d(atan2(x,2),[x,...

Calculate

atan2-float

atan2(2,3);

float(atan(7.9/6));

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) 
[abs,acos,asin,atan2,expand,float,linsolve,matrix,pi,rhs,sqrt,time] [acos,asin,atan2,expand,float,linsolve,matrix,pi,rhs,sqrt,time] [acos,asin,atan2,expand,float,linsolve,matrix,pi,rhs,sqrt] [acos,atan2,beta,cos,float,gamma,matrix,sin] [args,asin,atan2,block,cos,flatten,float,ident,length,make_random_state,makelist,matrix,set_random_state,sin,sqrt,subst,transpose] [args,asin,atan2,block,cos,flatten,float,ident,length,make_random_state,makelist,matrix,set_random_state,sin,sqrt,transpose] [args,asin,atan2,block,cos,flatten,float,ident,length,make_random_state,makelist,matrix,set_random_state,sin,sqrt] [args,asin,atan2,block,cos,flatten,float,ident,length,make_random_state,makelist,set_random_state,sqrt] [args,asin,atan2,block,cos,flatten,float,length,make_random_state,makelist,set_random_state,sqrt] [asin,atan2,beta,cos,float,gamma,matrix,sin] [asin,atan2,block,cos,ident,length,make_random_state,makelist,matrix,set_random_state,sin,sqrt] [asin,atan2,build_info,cos,float,ident,length,lsum,make_random_state,makelist,ratsimp,set_random_state,sqrt] [asin,atan2,cos,float,fpprintprec,ident,lambda,length,lsum,make_random_state,makelist,map,ratsimp,set_random_state,sqrt] [asin,atan2,cos,sqrt,transpose] [atan2,coeff,num,plot2d,sin] [atan2,collectterms,cos,expand,factor,float,log,plot2d,ratsimp,sin,solve,tan,trigexpand] [atan2,collectterms,cos,expand,factor,float,log,plot2d,ratsimp,sin,tan,trigexpand] [atan2,collectterms,cos,expand,factor,float,log,plot2d,sin,tan,trigexpand] [atan2,collectterms,cos,expand,float,log,plot2d,sin,tan,trigexpand,trigreduce] [atan2,collectterms,cos,expand,float,log,plot2d,sin,tan,trigexpand] [atan2,collectterms,cos,expand,float,log,plot2d,tan] [atan2,cos,diff,sin] [atan2,cos,expand,float,log,plot2d,tan] [atan2,cos,float,log,plot2d,tan] [atan2,cos,imagpart,plot2d,realpart,sin,sqrt] [atan2,cos,num,pi,plot2d] [atan2,cos,num,plot2d] [atan2,cos,numer,phi,sin,sqrt,true] [atan2,cos,plot2d,sin] [atan2,cos,sin,taylor] [atan2,cos,sin] [atan2,cos] [atan2,diff,exp] [atan2,diff,sqrt] [atan2,ev,numer,sqrt] [atan2,eval,plot3d,sqrt] [atan2,eval,plot3d] [atan2,exp,linsolve] [atan2,float,kill,pi,solve] [atan2,float,matrix,pi] [atan2,float] [atan2,log,plot2d] [atan2,num,plot2d] [atan2,numer,solve,sqrt] [atan2,pi] [atan2,plot2d] [atan2,plot3d,sqrt] [atan2,plot3d] [atan2,sqrt] [atan2]

Related Help

Help for Atan2