4 void ParkingSlot::reverse_border()
7 this->x4(), this->y4(),
8 this->x3(), this->y3(),
9 this->x2(), this->y2(),
10 this->x1(), this->y1()
15 double ParkingSlot::heading() const
17 return atan2(this->y4() - this->y1(), this->x4() - this->x1());
20 bool ParkingSlot::parallel() const
23 pow(this->x2() - this->x1(), 2)
24 + pow(this->y2() - this->y1(), 2)
27 pow(this->x3() - this->x2(), 2)
28 + pow(this->y3() - this->y2(), 2)
36 bool ParkingSlot::right() const
39 (this->x2() - this->x1()) * (this->y4() - this->y1())
40 - (this->y2() - this->y1()) * (this->x4() - this->x1())
48 void ParkingSlot::set_slot(
56 double x1 = x + w/2 * cos(h - M_PI/2);
57 double y1 = y + w/2 * sin(h - M_PI/2);
58 double x2 = x + l * cos(h) + w/2 * cos(h - M_PI/2);
59 double y2 = y + l * sin(h) + w/2 * sin(h - M_PI/2);
60 double x3 = x + l * cos(h) + w/2 * cos(h + M_PI/2);
61 double y3 = y + l * sin(h) + w/2 * sin(h + M_PI/2);
62 double x4 = x + w/2 * cos(h + M_PI/2);
63 double y4 = y + w/2 * sin(h + M_PI/2);
64 this->border(x1, y1, x2, y2, x3, y3, x4, y4);
67 ParkingSlot::ParkingSlot()