public static FactorFormula LinearToZeroInRadius(SpotEntity spot) { return(p => { double d = spot.GetDistTo(p); return (d > spot.ServingRadius) ? 0 : spot.Coefficient *(1 - d / spot.ServingRadius); }); }
public static FactorFormula ExponentialAttenuation(SpotEntity spot) { return(p => { double d = spot.GetDistTo(p); return Math.Pow(spot.Coefficient, 1 - d / spot.ServingRadius); }); }
public static FactorFormula ZeroOne(SpotEntity spot) { return(p => { double d = spot.GetDistTo(p); return (d > spot.ServingRadius) ? 0 : spot.Coefficient; }); }
public static FactorFormula InverseSquare(SpotEntity spot, double maxValue = double.MaxValue) { return(p => { double d = spot.GetDistTo(p); double v = spot.Coefficient / d / d; if (v > 0) { return v > maxValue ? maxValue : v; } else { return v < -maxValue ? -maxValue : v; } }); }