Files
PhotonVision/Main/src/main/java/com/chameleonvision/util/MathHandler.java
ori agranat eb65156548 merge bugfix
2019-10-07 21:15:17 +03:00

25 lines
548 B
Java

package com.chameleonvision.util;
import java.lang.Math;
import org.apache.commons.math3.util.FastMath;
public class MathHandler {
MathHandler() {}
public static double sigmoid(double x){
double bias = 0;
double a = 5;
double b = -0.05;
double k = 200;
if (x < 50){
bias = -1.338;
}
return ((k / (1 + Math.pow(Math.E,(a + (b * x))))) + bias);
}
public static double toSlope(double angle){
return FastMath.atan(FastMath.toRadians(angle - 90));
}
}