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: Point.cpp
- Revision:
- 5:d7d16cb9c974
- Parent:
- 4:f1e33a234a74
--- a/Point.cpp Tue May 12 16:21:33 2015 +0000 +++ b/Point.cpp Mon Aug 17 21:56:25 2015 +0000 @@ -3,18 +3,18 @@ //*********************point class************************// Point :: Point (void){ - positionRadian = 180; + positionRadian = 90; positionHeight = 4; positionDistance = 8; - //int offAngles [8] = {-3, 174, 44, 228, 90, 270, 135, 315}; offAngles[0] = -6; offAngles[1] = 174; offAngles[2] = 44; offAngles[3] = 228; - offAngles[4] = 90; - offAngles[5] = 270; - offAngles[6] = 135; + offAngles[4] = 92; + offAngles[5] = 275; + offAngles[6] = 145; offAngles[7] = 323; + //Point(90, 4, 8); } Point :: Point (int posRadian, int posHeight, int posDistance){ @@ -25,13 +25,17 @@ offAngles[1] = 174; offAngles[2] = 44; offAngles[3] = 228; - offAngles[4] = 90; - offAngles[5] = 270; - offAngles[6] = 135; + offAngles[4] = 92; + offAngles[5] = 275; + offAngles[6] = 145; offAngles[7] = 323; -} +} + int Point :: getArraySlice (void){ - return (int) (positionRadian + (offAngles[positionHeight]))%360; + return ((positionRadian + offAngles[positionHeight])%360); +} +int Point :: getDegree (void){ + return positionRadian % 360; } char Point :: getIdentifyingChar(void){ return 0x01 << positionHeight;