code: public static Twilight getTwilight(double sunDistanceRadians) {
  
  		double altDegrees = 90.0 - Math.toDegrees(sunDistanceRadians);
  		if (altDegrees >= 0.0) {
  			return Twilight.DAYLIGHT;
  		} else if (altDegrees >= -6.0) {
  			return Twilight.CIVIL;
  		} else if (altDegrees >= -12.0) {
  			return Twilight.NAUTICAL;
  		} else if (altDegrees >= -18.0) {
  			return Twilight.ASTRONOMICAL;
  		}
  
  		return Twilight.NIGHT;
  	}
docs: Return the twilight condition for a point which is a given great circle
  distance from the current sub solar point.
  
  
  @param sunDistanceRadians
  - from the current positon to the sub solar point
  @return The twilight condition