public double squaredDistanceFromCamera(double x, double y, double z) {
    double dx = (distance * sinZ) - x;
    double dy = (distance * -cosZ) - y;
    double dz = height - z;
    return dx * dx + dy * dy + dz * dz;
  }
public double squaredDistanceFromCamera ( double x , double y , double z ) { double dx = ( distance * sinZ ) - x ; double dy = ( distance * - cosZ ) - y ; double dz = height - z ; return dx * dx + dy * dy + dz * dz ; }
Distance from camera

@param x X position
@param y Y position
@param z Z position
@return Squared distance