Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: EuclidPoint.cpp
- Revision:
- 1:bb1507f0bb64
- Parent:
- 0:ded79d89abdf
- Child:
- 5:d7d16cb9c974
--- a/EuclidPoint.cpp Fri May 01 05:33:50 2015 +0000 +++ b/EuclidPoint.cpp Fri May 01 09:22:50 2015 +0000 @@ -2,6 +2,17 @@ #include "EuclidPoint.h" #include <math.h> +Point EuclidPoint :: getPoint(){ + int degree = (atan2((double)y, (double)x)) * 57.295; + if (degree < 0){ + degree = 360 + degree; + } + double dradius = sqrt((double)(x * x ) + (double)(y * y)); + int radius = rint(dradius) - 1; + Point pointer = Point(degree, z, radius); + return pointer; +} + int EuclidPoint:: getFirstCrossingDegree (int xl, int yl){ // returns the degree of the first cross double dradius = sqrt((double)(xl * xl ) + (yl * yl)); @@ -54,6 +65,7 @@ } + EuclidPoint :: EuclidPoint(void){ x = 0; y = 3;