9 #define _USE_MATH_DEFINES
22 #define DEG2RAD M_PI/180.0
36 theta = fmod(t_init, 360.0);
43 setOrigin(x_init, y_init, t_init);
48 if (x != other.x)
return true;
49 if (y != other.y)
return true;
50 if (theta != other.theta)
return true;
71 v1.
x = double(cell.
x) * this->m_resolution;
72 v1.
y = double(cell.
y) * this->m_resolution;
73 v1.
x = +v1.
x + m_origin.get_x() + 0 * this->m_resolution;
74 v1.
y = -v1.
y + m_origin.get_y() + (m_height - 1) * this->m_resolution;
78 v2.
x = v1.
x * m_origin.get_ca() - v1.
y * -m_origin.get_sa();
79 v2.
y = v1.
x * -m_origin.get_sa() + v1.
y * m_origin.get_ca();
88 world2.
x = world.
x * m_origin.get_ca() - world.
y * m_origin.get_sa();
89 world2.
y = world.
x * m_origin.get_sa() + world.
y * m_origin.get_ca();
90 int x = int((+world2.
x - this->m_origin.get_x()) / this->m_resolution) + 0;
91 int y = int((-world2.
y + this->m_origin.get_y()) / this->m_resolution) + m_height - 1;
93 c.
x = (x < 0) ? 0 : x;
94 c.
y = (y < 0) ? 0 : y;
95 c.
x = (c.
x >= m_width) ? m_width-1 : c.
x;
96 c.
y = (c.
y >= m_height) ? m_height-1 : c.
y;
105 world2.
x = world.
x * m_origin.get_ca() - world.
y * m_origin.get_sa();
106 world2.
y = world.
x * m_origin.get_sa() + world.
y * m_origin.get_ca();
108 c.
x = int((+world2.
x - this->m_origin.get_x()) / this->m_resolution) + 0;
109 c.
y = int((-world2.
y + this->m_origin.get_y()) / this->m_resolution) + m_height - 1;
115 XYCell cell = world2Cell_unsafeFast(world);
116 return isInsideMap(cell);
123 if (cell.
x >= m_width)
125 if (cell.
y >= m_height)
132 XYWorld wrld = cell2World(cell);
144 XYCell cell = world2Cell(wrld);