ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Revision:
39:e128071a95b0
Parent:
28:e09b7ac11dea
--- a/Math/Math.h	Sat Apr 27 16:06:33 2019 +0000
+++ b/Math/Math.h	Mon Apr 29 16:30:47 2019 +0000
@@ -1,8 +1,27 @@
 #ifndef MATH_H
 #define MATH_H
     
+/**
+ * Namespace for maths-related helper functions
+ */
 namespace Math {
+    /**
+     * @brief lerp with a default value basically
+     * a 'curried' lerp with t = 0.6
+     * @see lerp
+     * @returns lerp(a, b, 0.6)
+     */
     int lerp(int a, int b);
+    
+    /**
+     * @brief Linear Interpolation, but works for ints
+     * so you never lerp to the same value twice, the 
+     * minimum | a - b | is 1. 
+     * @param a The starting value (t = 0)
+     * @param b The value when t = 1
+     * @param t The amount to interpolate
+     * @returns a * (t - 1) + b * t
+     */
     int lerp(int a, int b, double t);
 }