public static CircularOrbitalPositionComponent CreateUnpoweredBody(Entity parent, double mass, double periodInDays, double meanAnomalyInDegrees, bool isPrograde, ICalendar calendar) { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } var parentMass = parent.GetRequiredComponent <OrbitalBodyCharacteristicsComponent>().Mass; var mu = Constants.GravitationalConstant * (mass + parentMass); var angularVelocity = (isPrograde ? 1 : -1) * 2.0 * Math.PI / (periodInDays * 24.0 * 3600.0); var orbitalRadius = Math.Pow(mu / (angularVelocity * angularVelocity), 1.0 / 3.0); var secondsFromEpoch = calendar.CreateTimePoint(2000, 1, 1).Tick *Constants.SecondsPerTick; var initialAngle = (secondsFromEpoch * angularVelocity) + meanAnomalyInDegrees / (2.0 * Math.PI); var relativePosition = new Point(orbitalRadius * Math.Cos(initialAngle), orbitalRadius * Math.Sin(initialAngle)); var angularVelocityPerTick = angularVelocity * Constants.SecondsPerTick; return(new CircularOrbitalPositionComponent(parent.Id, relativePosition, angularVelocityPerTick, orbitalRadius)); }