PiCam Tweaks (#63)

* Update QuirkyCamera to do name-based matching

* Add pi-cam exposure set

* Refactor QuirkyCamera

* Add PiCam quirk test, fix tests for no-name quirky cameras

* Apply Spotless

* Add pinhole model unit test
This commit is contained in:
Banks T
2020-09-08 12:11:29 -04:00
committed by GitHub
parent 7bf92a9db3
commit ddd15d362b
7 changed files with 99 additions and 22 deletions

View File

@@ -39,6 +39,14 @@ public class MathUtils {
return FastMath.atan(FastMath.toRadians(angle.doubleValue() - 90));
}
public static int safeDivide(int quotient, int divisor) {
if (divisor == 0) {
return 0;
} else {
return quotient / divisor;
}
}
public static double roundTo(double value, int to) {
double toMult = Math.pow(10, to);
return (double) Math.round(value * toMult) / toMult;