Here you can find the source of between(double a, double b, double candidate)
private static boolean between(double a, double b, double candidate)
//package com.java2s; //License from project: Open Source License public class Main { private static boolean between(double a, double b, double candidate) { double min = Math.min(a, b); double max = Math.max(a, b); return candidate >= min && candidate <= max; }/*from ww w . jav a2s . c o m*/ }