1#ifndef J_TWO_D_TRANSFORM_H
2#define J_TWO_D_TRANSFORM_H
37 return { fb, -sideways, (float)radians(-turn) };
52 return -degrees(t.
theta);
63 this->y = this->y + cos(this->theta) * t.
y + sin(this->theta) * t.
x;
64 this->x = this->x + cos(this->theta) * t.
x + sin(this->theta) * t.
y;
65 this->theta = this->theta + t.
theta;
71 this->y = this->y + t.
y;
72 this->theta = this->theta + t.
theta;
73 this->x = this->x + t.
x;
78 this->y = this->y - t.
y;
79 this->theta = this->theta - t.
theta;
80 this->x = this->x - t.
x;
85 this->y = this->y * t.
y;
86 this->theta = this->theta * t.
theta;
87 this->x = this->x * t.
x;
92 this->y = this->y / t.
y;
93 this->theta = this->theta / t.
theta;
94 this->x = this->x / t.
x;
99 this->y = this->y * v;
100 this->theta = this->theta * v;
101 this->x = this->x * v;
106 this->y = this->y / v;
107 this->theta = this->theta / v;
108 this->x = this->x / v;
114 this->theta = -this->
theta;
121 this->theta += t.
theta;
128 this->theta -= t.
theta;
135 this->theta *= t.
theta;
142 this->theta /= t.
theta;
196 return abs(this->y) + abs(this->x) + abs(this->theta);
204 void print(
bool labels =
true,
bool newline =
false, Stream* serial = &Serial)
207 serial->print(
"x_fb:");
211 serial->print(
"y_lr:");
215 serial->print(
"rz_ccw:");
216 serial->print(
theta, 5);