44 #ifndef _TRANSFORMATION2_HXX_ 45 #define _TRANSFORMATION2_HXX_ 63 inline const T&
x()
const {
return values[0];}
65 inline const T&
y()
const {
return values[1];}
68 inline T&
x() {
return values[0];}
70 inline T&
y() {
return values[1];}
74 return values[0]*values[0]+values[1]*values[1];
124 inline const T&
x()
const {
return values[0];}
126 inline const T&
y()
const {
return values[1];}
128 inline const T&
theta()
const {
return values[2];}
131 inline T&
x() {
return values[0];}
133 inline T&
y() {
return values[1];}
135 inline T&
theta() {
return values[2];}
139 values[0]=0.; values[1]=0.; values[2]=0.;
143 Pose2(
const T&
x,
const T&
y,
const T& theta){
144 values[0]=
x, values[1]=
y, values[2]=theta;
152 for (
int i=0; i<3; i++){
162 T rotationMatrix[2][2];
163 T translationVector[2];
169 if (initAsIdentity) {
170 rotationMatrix[0][0]=1.; rotationMatrix[0][1]=0.;
171 rotationMatrix[1][0]=0.; rotationMatrix[1][1]=1.;
172 translationVector[0]=0.;
173 translationVector[1]=0.;
192 setTranslation(trans.
x(), trans.
y());
198 setRotation(v.
theta());
199 setTranslation(v.
x(),v.
y());
206 translationVector[1]);
211 return atan2(rotationMatrix[1][0],rotationMatrix[0][0]);
224 setTranslation(t.
x(),t.
y());
229 T s=
sin(theta), c=
cos(theta);
230 rotationMatrix[0][0]=c, rotationMatrix[0][1]=-s;
231 rotationMatrix[1][0]=s, rotationMatrix[1][1]= c;
236 translationVector[0]=
x;
237 translationVector[1]=
y;
243 for (
int i=0; i<2; i++)
244 for (
int j=0; j<2; j++){
248 for (
int i=0; i<2; i++){
250 for (
int j=0; j<2; j++){
275 for (
int i=0; i<2; i++)
276 for (
int j=0; j<2; j++){
278 for (
int k=0; k<2; k++)
281 for (
int i=0; i<2; i++){
283 for (
int j=0; j<2; j++)
305 for (
int i=0; i<3; i++){
307 for (
int j=0; j<3; j++)
317 for (
int i=0; i<3; i++)
318 for (
int j=0; j<3; j++)
327 for (
int i=0; i<3; i++)
328 for (
int j=0; j<3; j++){
330 for (
int k=0; k<3; k++){
341 for (
int i=0; i<3; i++)
342 for (
int j=0; j<3; j++){
355 T dm=values[2][0]*values[1][1]*values[0][2]
356 +values[2][1]*values[1][2]*values[0][0]
357 +values[2][2]*values[1][0]*values[0][1];
365 for (
int i=0; i<3; i++)
366 for (
int j=0; j<3; j++)
376 m.
values[0][1]=-values[1][0]*values[2][2]+values[1][2]*values[2][0];
377 m.
values[0][2]= values[1][0]*values[2][1]-values[2][0]*values[1][1];
378 m.
values[1][0]=-values[0][1]*values[2][2]+values[2][1]*values[0][2];
379 m.
values[1][1]= values[0][0]*values[2][2]-values[2][0]*values[0][2];
380 m.
values[1][2]=-values[0][0]*values[2][1]+values[2][0]*values[0][1];
381 m.
values[2][0]= values[0][1]*values[1][2]-values[1][1]*values[0][2];
382 m.
values[2][1]=-values[0][0]*values[1][2]+values[1][0]*values[0][2];
383 m.
values[2][2]= values[0][0]*values[1][1]-values[1][0]*values[0][1];
Vector2< T > TranslationType
Template class for representing a 2D point (x and y coordinate)
Tenmplate class to define the operations in 2D.
SMatrix3< T > InformationType
Transformation2< T > TransformationType
Vector2< T > operator*(const T &d, const Vector2< T > &v)
A class to represent symmetric 3x3 matrices.
Pose2(const T &x, const T &y, const T &theta)
SMatrix3< T > transpose() const
GLM_FUNC_DECL genType cos(genType const &angle)
GLM_FUNC_DECL genType sin(genType const &angle)
SMatrix3< T > inv() const
T values[3]
container for x, y, and theta
SMatrix3< T > adj() const
SMatrix3< T > CovarianceType
GLM_FUNC_QUALIFIER T atan2(T x, T y)
Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what q...
Vector2< T > operator+(const Vector2< T > &v1, const Vector2< T > &v2)
GLM_FUNC_DECL detail::tquat< T, P > rotation(detail::tvec3< T, P > const &orig, detail::tvec3< T, P > const &dest)
Pose2< T > ParametersType
Vector2< T > operator-(const Vector2< T > &v1, const Vector2< T > &v2)
T values[2]
container for x and y
2D Point (x,y) with orientation (theta)