[Rock-dev] base::Angle

Janosch Machowinski Janosch.Machowinski at dfki.de
Fri Apr 12 12:07:54 CEST 2013


Actually in this case I need a new name for invert
opposite would be the replacement for inverse()

Suggestions ?
Greetings
     Janosch

+    inline Angle inverse() const
+    {
+        return Angle(rad).invert();
+    }
+
+    /**
+     * Inverts the current angle
+     * */
+    inline Angle &invert()
+    {
+        if(rad < 0)
+            rad += M_PI;
+        else
+            rad -=M_PI;
+        return *this;
+    }
+


On 12.04.2013 12:02, Jakob Schwendner wrote:
> opposite() I also like better than invert().
> cheers,
> Jakob
>
> On April 12, 2013 at 11:58 AM Felix Rehrmann <felix.rehrmann at dfki.de> 
> wrote:
> > Hi,
> >
> > if I understand the invert function correctly I would prefer to call it
> > opposite or oppositeDirection (inversion sounds somehow strange with
> > regard to angles).
> >
> > Felix
> >
> > Am 12.04.2013 11:48, schrieb Janosch Machowinski:
> > > Hey,
> > > I want to extend base::Angle by two methods but I am not
> > > sure about the naming of the methods.
> > >
> > > One would be :
> > > /**
> > > * Inverts the current angle
> > > * */
> > > inline Angle &invert()
> > > {
> > > if(rad < 0)
> > > rad += M_PI;
> > > else
> > > rad -=M_PI;
> > > return *this;
> > > }
> > >
> > >
> > > The other would be :
> > > Angle operator-()
> > > {
> > > rad = -rad;
> > > }
> > >
> > > Is this an correct intuitive naming scheme ?
> > > Better ideas ?
> > > Greetings
> > > Janosch
> > >
> > >
> > > _______________________________________________
> > > Rock-dev mailing list
> > > Rock-dev at dfki.de
> > > http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
>
>
>
> _______________________________________________
> Rock-dev mailing list
> Rock-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev

-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20130412/05aef304/attachment.htm 


More information about the Rock-dev mailing list