Go to the source code of this file.
Functions | |
| quat | vr2q (const vec &v, const double &_r) |
| quat | vt2q (const vec &v, const double &theta) |
| void | swap (vec &v1, vec &v2) |
|
||||||||||||
|
return quat from vec and real Definition at line 3 of file vec-misc.hpp. Referenced by orbit(), and rotate().
|
|
||||||||||||
|
return quat from vec and angle Definition at line 10 of file vec-misc.hpp. References normal(), vec::x, vec::y, and vec::z. 00011 {
00012 vec n(normal(v));
00013 double sin_theta_half(std::sin(0.5*theta));
00014 return quat( n.x*sin_theta_half, n.y*sin_theta_half, n.z*sin_theta_half,
00015 std::cos(0.5*theta) );
00016 }
|
|
||||||||||||
|
swap two vecs Definition at line 24 of file vec-misc.hpp. 00025 {
00026 vec _v1(v1);
00027 v1 = v2;
00028 v2 =_v1;
00029 }
|
1.4.1