Here you can find the source of clip(double value, double min, double max)
Parameter | Description |
---|---|
value | The value |
min | The min value |
max | The max value |
public static double clip(double value, double min, double max)
//package com.java2s; //License from project: LGPL public class Main { /**/*from w w w .j a v a 2s. c o m*/ * @param value The value * @param min The min value * @param max The max value * @return The clipped value between min and max */ public static double clip(double value, double min, double max) { if (value > max) value = max; if (value < min) value = min; return value; } }