Updated code taking into account Adam's comments + bugfix

This commit is contained in:
Hombre
2016-02-13 17:54:47 +01:00
parent 4665b88788
commit de7c6d773a
13 changed files with 539 additions and 571 deletions

View File

@@ -187,23 +187,23 @@ public:
{
radius *= scale;
}
PolarCoord operator+(PolarCoord & rhs)
PolarCoord operator+ (const PolarCoord& rhs) const
{
PolarCoord result;
Coord thisCoord, rhsCoord;
thisCoord.setFromPolar(*this);
rhsCoord.setFromPolar(rhs);
thisCoord += rhsCoord;
PolarCoord result;
result.setFromCartesian(thisCoord);
return result;
}
PolarCoord operator-(PolarCoord & rhs)
PolarCoord operator- (const PolarCoord& rhs) const
{
PolarCoord result;
Coord thisCoord, rhsCoord;
thisCoord.setFromPolar(*this);
rhsCoord.setFromPolar(rhs);
thisCoord -= rhsCoord;
PolarCoord result;
result.setFromCartesian(thisCoord);
return result;
}