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.
Dependencies: HIDScope PID QEI mbed EMG
Fork of PID_VelocityExample by
Diff: Point.cpp
- Revision:
- 14:102a2b4f5c86
- Parent:
- 9:07189a75e979
--- a/Point.cpp Tue Oct 06 11:30:38 2015 +0000
+++ b/Point.cpp Tue Oct 06 14:17:11 2015 +0000
@@ -27,10 +27,10 @@
}
bool fromRotational(float a, float b)
{
- rotA = a*M_PI/180;
- rotB = b*M_PI/180;
- posX = (tan(rotB)*l)/(tan(rotA)+tan(rotB));
- posY = tan(rotA)*posX;
+ rotA = a;
+ rotB = b;
+ posX = (tan(rotB*M_PI/180)*l)/(tan(rotA*M_PI/180)+tan(rotB*M_PI/180));
+ posY = tan(rotA*M_PI/180)*posX;
return true;
