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: CANnucleo FastPWM3 mbed
Fork of Hobbyking_Cheetah_Compact by
math_ops.cpp
00001 00002 #include "math_ops.h" 00003 00004 00005 float fmaxf(float x, float y){ 00006 return (((x)>(y))?(x):(y)); 00007 } 00008 00009 float fminf(float x, float y){ 00010 return (((x)<(y))?(x):(y)); 00011 } 00012 00013 float fmaxf3(float x, float y, float z){ 00014 return (x > y ? (x > z ? x : z) : (y > z ? y : z)); 00015 } 00016 00017 float fminf3(float x, float y, float z){ 00018 return (x < y ? (x < z ? x : z) : (y < z ? y : z)); 00019 } 00020 00021 void limit_norm(float *x, float *y, float limit){ 00022 float norm = sqrt(*x * *x + *y * *y); 00023 if(norm > limit){ 00024 *x = *x * limit/norm; 00025 *y = *y * limit/norm; 00026 } 00027 }
Generated on Tue Aug 2 2022 05:17:53 by
