/** returns the factor index for the statistics array */ public static int getFactorIndex(Wave wave, Point2D.Double target) { double offsetAngle = (absoluteBearing(wave.getOrigin(), target) - wave.getAngle()); double factor = Utils.normalRelativeAngle(offsetAngle) / maxEscapeAngle(wave.getVelocity()) * wave.getDirection(); return computeBin(factor); }