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.
Fork of Eurobot2013 by
geometryfuncs.h
00001 #ifndef GEOMETRYFUNCS_H 00002 #define GEOMETRYFUNCS_H 00003 00004 // rectifies angle to range -PI to PI 00005 template <typename T> 00006 T rectifyAng (T ang_in) { 00007 ang_in -= (floor(ang_in/(2*PI)))*2*PI; 00008 if (ang_in < -PI) { 00009 ang_in += 2*PI; 00010 } 00011 if (ang_in > PI) { 00012 ang_in -= 2*PI; 00013 } 00014 00015 return ang_in; 00016 } 00017 00018 #endif //GEOMETRYFUNCS_H
Generated on Tue Jul 12 2022 18:53:25 by
1.7.2
