/*! Get front track. */
double ft() const;
+ /*! Return rear axle center to right rear corner Euclidean distance. */
+ double edist_to_rr() const;
+
+ /*! Return rear axle center to left front corner Euclidean distance. */
+ double edist_to_lf() const;
+
/*! \brief Get minimum turning radius.
*
* Please, note that the method returns really _minimum turning radius_,
return this->_front_track;
}
+double
+CarSize::edist_to_rr() const
+{
+ return sqrt(pow(this->w() / 2.0, 2) + pow(this->len() - this->df(), 2));
+}
+
+double
+CarSize::edist_to_lf() const
+{
+ return sqrt(pow(this->w() / 2.0, 2) + pow(this->df(), 2));
+}
+
double
CarSize::mtr() const
{
WVPASSEQ_DOUBLE(0.0, bc.x(), 0.00001);
WVPASSEQ_DOUBLE(2.0, bc.y(), 0.00001);
WVPASSEQ_DOUBLE(M_PI / 2.0, bc.h(), 0.00001);
+
+ // distance to rr, lf
+ WVPASSEQ_DOUBLE(0.70710677, bc.edist_to_rr(), 10e-5);
+ WVPASSEQ_DOUBLE(bc.edist(bc.rr()), bc.edist_to_rr(), 10e-5);
+ WVPASSEQ_DOUBLE(2.5495098, bc.edist_to_lf(), 10e-5);
+ WVPASSEQ_DOUBLE(bc.edist(bc.lf()), bc.edist_to_lf(), 10e-5);
}
WVTEST_MAIN("test collide functions")