]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - incl/bcar.hh
Add edist to rr, lf method
[hubacji1/bcar.git] / incl / bcar.hh
index 71e4f505c9a698352d330dc5e113740a4563b185..658db31042b6bbc3ae116cd92ce36421f3315ea2 100644 (file)
@@ -55,6 +55,12 @@ public:
         */
        bool inside_of(std::vector<Point> const& poly) const;
 
+       /*! \brief Return `true` if `this` point is inside the circle `c`, `r`.
+        *
+        * \see * https://math.stackexchange.com/questions/198764/how-to-know-if-a-point-is-inside-a-circle#198769
+        */
+       bool inside_of(Point const& c, double const r) const;
+
        /*! \brief Return `true` if on the right side of the plane.
         *
         * The plane is given by the line `li`, where `li->b()` is the base
@@ -144,6 +150,9 @@ public:
 
        double h() const;
 
+       /*! Generate output for plotting with gnuplot. */
+       void gen_gnuplot_to(std::ostream& out);
+
        friend std::ostream& operator<<(std::ostream& out, Line const& li);
 };
 
@@ -256,6 +265,12 @@ public:
        /*! 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_,
@@ -293,6 +308,20 @@ public:
         */
        double orradi() const;
 
+       /*! \brief Return inner mirror radius.
+        *
+        * The inner mirror radius is the distance from minimum turning radius
+        * circle center to the farther mirror (from the rear axle view).
+        */
+       double imradi() const;
+
+       /*! \brief Return outer mirror radius.
+        *
+        * The outer mirror radius is the distance from minimum turning radius
+        * circle center to the farther mirror (from the rear axle view).
+        */
+       double omradi() const;
+
        /*! \brief Return length of perfect parking slot.
         *
         * The width of the slot is the same as the width of the car.
@@ -466,22 +495,33 @@ public:
        /*! Options for generating output for gnuplot. */
        class GenPlotOpts {
        public:
-               static bool LEFT;
-               static bool RIGHT;
-               static bool REAR;
-               static bool FRONT;
-               static bool FRAME;
-               static bool ARROW;
-               static bool CROSS;
-               static bool CAR;
-               static bool LEFT_MIRROR;
-               static bool RIGHT_MIRROR;
-               static bool MIRRORS;
-               static bool ALL;
+               bool LF_POINT = false;
+               bool LR_POINT = false;
+               bool RR_POINT = false;
+               bool RF_POINT = false;
+               bool LFM_POINT = false;
+               bool RFM_POINT = false;
+               bool CRA_POINT = false;
+               bool CAR_POINT = false;
+               bool LRA_POINT = false;
+               bool RRA_POINT = false;
+
+               bool LEFT = false;
+               bool RIGHT = false;
+               bool REAR = false;
+               bool FRONT = false;
+               bool FRAME = false; // LEFT, RIGHT, REAR, FRONT
+               bool ARROW = false;
+               bool CROSS = false;
+               bool CAR = false; // CROSS, ARROW, FRAME
+               bool LEFT_MIRROR = false;
+               bool RIGHT_MIRROR = false;
+               bool MIRRORS = false; // RIGHT_MIRROR, LEFT_MIRROR
+               bool ALL = true; // MIRRORS, CAR
        };
 
        /*! Generate output for plotting with gnuplot. */
-       void gen_gnuplot_to(std::ostream& out, GenPlotOpts const& opts);
+       void gen_gnuplot_to(std::ostream& out, GenPlotOpts opts);
 };
 
 } // namespace bcar