The ``a_1`` should be direction of ``bc`` related to ``this``.
// kinematic constraints
bool BicycleCar::drivable(const BicycleCar &bc) const
{
+ double a_1 = atan2(bc.y() - this->y(), bc.x() - this->x()) - this->h();
+ while (a_1 < -M_PI)
+ a_1 += 2 * M_PI;
+ while (a_1 > +M_PI)
+ a_1 -= 2 * M_PI;
+ if (0 <= a_1 && a_1 <= M_PI/2) { // left front
+ } else if (M_PI/2 < a_1 && a_1 <= M_PI) { // left rear
+ } else if (0 > a_1 && a_1 >= -M_PI/2) { // right front
+ } else if (-M_PI/2 > a_1 && a_1 >= -M_PI) { // right rear
+ } else {
+ // Not happenning, as ``-pi <= a <= pi``.
+ }
return false;
}