Java Double Number Clamp clampVector(double d)

Here you can find the source of clampVector(double d)

Description

clamp Vector

License

Open Source License

Declaration

private static double clampVector(double d) 

Method Source Code

//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*/
}

Related

  1. clampMax(double val, double max)
  2. clampMax(final double MAX, final double VALUE)
  3. clampMin(double input, double min)
  4. clampRoundShort(double in)
  5. clampToPercentageOrNAN(double input)