Go to the documentation of this file.00001 Matrix3d skew(const Vector3d&v)
00002 {
00003 Matrix3d m;
00004 m.fill(0.);
00005 m(0,1) = -v(2);
00006 m(0,2) = v(1);
00007 m(1,2) = -v(0);
00008 m(1,0) = v(2);
00009 m(2,0) = -v(1);
00010 m(2,1) = v(0);
00011 return m;
00012 }
00013
00014 Vector3d deltaR(const Matrix3d& R)
00015 {
00016 Vector3d v;
00017 v(0)=R(2,1)-R(1,2);
00018 v(1)=R(0,2)-R(2,0);
00019 v(2)=R(1,0)-R(0,1);
00020 return v;
00021 }
00022
00023 Vector2d project(const Vector3d& v)
00024 {
00025 Vector2d res;
00026 res(0) = v(0)/v(2);
00027 res(1) = v(1)/v(2);
00028 return res;
00029 }
00030
00031 Vector3d project(const Vector4d& v)
00032 {
00033 Vector3d res;
00034 res(0) = v(0)/v(3);
00035 res(1) = v(1)/v(3);
00036 res(2) = v(2)/v(3);
00037 return res;
00038 }
00039
00040 Vector3d unproject(const Vector2d& v)
00041 {
00042 Vector3d res;
00043 res(0) = v(0);
00044 res(1) = v(1);
00045 res(2) = 1;
00046 return res;
00047 }
00048
00049 Vector4d unproject(const Vector3d& v)
00050 {
00051 Vector4d res;
00052 res(0) = v(0);
00053 res(1) = v(1);
00054 res(2) = v(2);
00055 res(3) = 1;
00056 return res;
00057 }