private decimal GetSignalAtBearing(decimal bearing, Point receiver, Emission incomingSignals, decimal frequency) { decimal signal = incomingSignals.GetAttenuatedSignal(frequency, receiver); if (signal <= 0) { return(0); } Point origin = incomingSignals.origin; decimal distance = (decimal)Global.GetDistanceToPoint(origin, receiver); decimal absBearing = (decimal)Global.GetBearingToPoint(origin, receiver); decimal convertedBearing = absBearing; if (convertedBearing > 180) { convertedBearing -= 360; } decimal relativeBearing = bearing - convertedBearing; if (relativeBearing < -180) { relativeBearing += 360; } decimal diffusedSignal = GetDiffusedSignal(relativeBearing, signal, distance); diffusedSignal = Math.Round(diffusedSignal, 2); return(diffusedSignal); }
public Emission Update() { FluctuateSignature(); Emission signals = new Emission(location, emissionSignature); return(signals); }