The orientation of the parking slot is computed as the
direction from the first to the last border coordinates.
*/
- double heading();
+ double heading() const;
/*! \brief Return `true` if slot is parallel.
There are two slot types - parallel and perpendicular.
*/
- bool parallel();
+ bool parallel() const;
/*! \brief Return `true` if slot is on the right.
The slot could be on right or the left side.
*/
- bool right();
+ bool right() const;
// getters, setters
double x1() const { return this->border_[0][0]; }
}
// slot info
-double ParkingSlot::heading()
+double ParkingSlot::heading() const
{
return atan2(this->y4() - this->y1(), this->x4() - this->x1());
}
-bool ParkingSlot::parallel()
+bool ParkingSlot::parallel() const
{
double d1 = sqrt(
pow(this->x2() - this->x1(), 2)
return false;
}
-bool ParkingSlot::right()
+bool ParkingSlot::right() const
{
if (sgn(
(this->x2() - this->x1()) * (this->y4() - this->y1())