Skip to content

Commit

Permalink
Update 18 February 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
RayAriasJr authored Feb 18, 2019
1 parent 8ac8cf3 commit 82bcdee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cartesian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,22 @@ int Cartesian::invert(int a) { return -a; }

double Cartesian::invert(double aa) { return -aa; }

void Cartesian::transpose(void) {
double zz = 0.0;
zz = xx;
xx = yy;
yy = zz;
concordanceDouble();
return; }

Cartesian Cartesian::transpose(Cartesian carte) {
double zz = 0.0;
zz = carte.xx;
carte.xx = carte.yy;
carte.yy = zz;
carte.concordanceDouble();
return carte; }

double Cartesian::distanceDouble(void) {
double dd = sqrt((xx * xx) + (yy * yy));
if ((xx < 0) && (yy > 0)) dd = -dd;
Expand Down
4 changes: 4 additions & 0 deletions Cartesian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ class Cartesian
int invert(int a);
double invert(double aa);

// Transpose x coordinate and y coordinate
void transpose(void);
Cartesian transpose(Cartesian carte);

// Calculate distance from current position to...
int distanceInt(void); // origin
double distanceDouble(void);
Expand Down

0 comments on commit 82bcdee

Please sign in to comment.