Commit 0b584a13 authored by Jakob Schöttl's avatar Jakob Schöttl
Browse files

Add clamp function to MathUtil

parent 91a38657
......@@ -23,7 +23,6 @@ import com.vividsolutions.jts.math.MathUtil;
*
* To enable this model, add this model's class name to the main model's submodel list and
* load a train topography.
*
*
*/
public class SeatingModel implements ActiveCallback, Model {
......
package org.vadere.util.math;
import java.awt.Point;
import java.awt.geom.Arc2D;
import java.util.*;
import java.util.AbstractMap.SimpleEntry;
......@@ -442,4 +441,9 @@ public class MathUtil {
}
return complex;
}
public static double clamp(double val, double min, double max) {
return Math.max(min, Math.min(max, val));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment