static class SKMath

This class contains some convenience math functions! StereoKit typically uses floats instead of doubles, so you won’t need to cast to and from using these methods.

Static Fields and Properties

   
float Pi The mathematical constant, Pi!
float Tau Tau is 2*Pi, there are excellent arguments that Tau can make certain formulas more readable!

Static Methods

   
AngleDist Calculates the minimum angle ‘distance’ between two angles. This covers wraparound cases like: the minimum distance between 10 and 350 is 20.
Cos Same as Math.Cos
Exp Same as Math.Exp
Lerp Blends (Linear Interpolation) between two scalars, based on a ‘blend’ value, where 0 is a, and 1 is b. Doesn’t clamp percent for you.
Mod Modulus, works better than ‘%’ for negative values.
Sin Same as Math.Sin
Sqrt Same as Math.Sqrt




Found an issue with these docs, or have some additional questions? Create an Issue on Github!