Here you can find the source of clampVector(double d)
private static double clampVector(double d)
//package com.java2s; //License from project: Open Source License public class Main { private static double clampVector(double d) { return d < 0 ? 0 : (d > 1 ? 1 : d); }/*from w w w . j av a 2 s. c o m*/ }