Here you can find the source of inRange(double x, double y, double z, double sx, double sy, double sz, double r)
public static boolean inRange(double x, double y, double z, double sx, double sy, double sz, double r)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean inRange(double x, double y, double z, double sx, double sy, double sz, double r) { return (((x - sx) * (x - sx)) + ((y - sy) * (y - sy)) + ((z - sz) * (z - sz))) <= (r * r); }//from w w w. ja va 2 s.c o m }