Inductance Testing Code

Dependencies:   mbed

Fork of CurrentModeSine by Austin Brown

Revision:
0:9edd6ec0f56a
Child:
1:64b881306f6f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/math_ops/math_ops.cpp	Sat May 20 21:42:20 2017 +0000
@@ -0,0 +1,27 @@
+
+#include "math_ops.h"
+
+
+float fmaxf(float x, float y){
+    return (((x)>(y))?(x):(y));
+    }
+
+float fminf(float x, float y){
+    return (((x)<(y))?(x):(y));
+    }
+
+float fmaxf3(float x, float y, float z){
+    return (x > y ? (x > z ? x : z) : (y > z ? y : z));
+    }
+
+float fminf3(float x, float y, float z){
+    return (x < y ? (x < z ? x : z) : (y < z ? y : z));
+    }
+    
+void limit_norm(float *x, float *y, float limit){
+    float norm = sqrt(*x * *x + *y * *y);
+    if(norm > limit){
+        *x = *x * limit/norm;
+        *y = *y * limit/norm;
+        }
+    }