Alexandre Lemay
/
APP1_s5_A17
PARTYYYY
Diff: Accelerometre.cpp
- Revision:
- 10:2836530d9a5e
- Parent:
- 6:909e7877d915
- Child:
- 11:09317efe9bb5
--- a/Accelerometre.cpp Tue Sep 05 10:27:28 2017 +0000 +++ b/Accelerometre.cpp Wed Sep 06 01:29:41 2017 +0000 @@ -24,9 +24,12 @@ ZValue = -1; } double angle =std::acos(ZValue); + // std::acos return a value from 0 to pi, adjust it to 0 to PI/2 ( 0 , 90 ) + if(angle > PI/2) + { + angle = PI - angle; + } return (angle*180/ PI); - - }