From 2434ad32fb7407c79161b26fe5b39d09f6723a4a Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Thu, 15 Jul 2021 12:06:42 +0200 Subject: [PATCH] Add car frame point and side getters --- incl/bcar.hh | 24 ++++++++++++++++++++++++ src/bcar.cc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/incl/bcar.hh b/incl/bcar.hh index a84053a..ad33a7d 100644 --- a/incl/bcar.hh +++ b/incl/bcar.hh @@ -320,6 +320,30 @@ public: /*! Get frame's right front y coordinate. */ double rfy() const; + /*! Get frame's left front point. */ + Point lf() const; + + /*! Get frame's left rear point. */ + Point lr() const; + + /*! Get frame's right rear point. */ + Point rr() const; + + /*! Get frame's right front point. */ + Point rf() const; + + /*! Get frame's left side. */ + Line left() const; + + /*! Get frame's rear side. */ + Line rear() const; + + /*! Get frame's right side. */ + Line right() const; + + /*! Get frame's front side. */ + Line front() const; + /*! Get rear axle's left x coordinate. */ double ralx() const; diff --git a/src/bcar.cc b/src/bcar.cc index 54d30b9..32b2b88 100644 --- a/src/bcar.cc +++ b/src/bcar.cc @@ -631,6 +631,54 @@ BicycleCar::rfy() const return rfy; } +Point +BicycleCar::lf() const +{ + return Point(this->lfx(), this->lfy()); +} + +Point +BicycleCar::lr() const +{ + return Point(this->lrx(), this->lry()); +} + +Point +BicycleCar::rr() const +{ + return Point(this->rrx(), this->rry()); +} + +Point +BicycleCar::rf() const +{ + return Point(this->rfx(), this->rfy()); +} + +Line +BicycleCar::left() const +{ + return Line(this->lr(), this->lf()); +} + +Line +BicycleCar::rear() const +{ + return Line(this->lr(), this->rr()); +} + +Line +BicycleCar::right() const +{ + return Line(this->rr(), this->rf()); +} + +Line +BicycleCar::front() const +{ + return Line(this->rf(), this->lf()); +} + double BicycleCar::ralx() const { -- 2.39.2