本文整理汇总了C#中Orbit.UpdateFromOrbitAtUT方法的典型用法代码示例。如果您正苦于以下问题:C# Orbit.UpdateFromOrbitAtUT方法的具体用法?C# Orbit.UpdateFromOrbitAtUT怎么用?C# Orbit.UpdateFromOrbitAtUT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orbit
的用法示例。
在下文中一共展示了Orbit.UpdateFromOrbitAtUT方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransferCalculator
protected TransferCalculator(
Orbit o, Orbit target,
double min_departure_time,
double max_departure_time,
double min_transfer_time,
double max_transfer_time,
int width,
int height)
{
originOrbit = o;
destinationOrbit = target;
origin = new Orbit();
origin.UpdateFromOrbitAtUT(o, min_departure_time, o.referenceBody);
destination = new Orbit();
destination.UpdateFromOrbitAtUT(target, min_departure_time, target.referenceBody);
maxDurationSamples = height;
dateSamples = width;
nextDateIndex = dateSamples;
this.minDepartureTime = min_departure_time;
this.maxDepartureTime = max_departure_time;
this.minTransferTime = min_transfer_time;
this.maxTransferTime = max_transfer_time;
computed = new ManeuverParameters[dateSamples, maxDurationSamples];
pendingJobs = 0;
#if DEBUG
log = new string[dateSamples, maxDurationSamples];
#endif
}
示例2: ReentrySimulation
public ReentrySimulation(Orbit _initialOrbit, double _UT, SimulatedVessel _vessel, SimCurves _simcurves, IDescentSpeedPolicy _descentSpeedPolicy, double _decelEndAltitudeASL, double _maxThrustAccel, double _parachuteSemiDeployMultiplier, double _probableLandingSiteASL, bool _multiplierHasError, double _dt, double _min_dt)
{
// Store all the input values as they were given
input_initialOrbit = _initialOrbit;
input_UT = _UT;
vessel = _vessel;
input_descentSpeedPolicy = _descentSpeedPolicy;
input_decelEndAltitudeASL = _decelEndAltitudeASL;
input_maxThrustAccel = _maxThrustAccel;
input_parachuteSemiDeployMultiplier = _parachuteSemiDeployMultiplier;
input_probableLandingSiteASL = _probableLandingSiteASL;
input_multiplierHasError = _multiplierHasError;
input_dt = _dt;
// the vessel attitude relative to the surface vel. Fixed for now
attitude = Quaternion.Euler(180,0,0);
min_dt = _min_dt;
max_dt = _dt;
dt = max_dt;
// Get a copy of the original orbit, to be more thread safe
initialOrbit = new Orbit();
initialOrbit.UpdateFromOrbitAtUT(_initialOrbit, _UT, _initialOrbit.referenceBody);
CelestialBody body = _initialOrbit.referenceBody;
bodyHasAtmosphere = body.atmosphere;
bodyRadius = body.Radius;
gravParameter = body.gravParameter;
this.parachuteSemiDeployMultiplier = _parachuteSemiDeployMultiplier;
this.multiplierHasError = _multiplierHasError;
bodyAngularVelocity = body.angularVelocity;
this.descentSpeedPolicy = _descentSpeedPolicy;
decelRadius = bodyRadius + _decelEndAltitudeASL;
aerobrakedRadius = bodyRadius + body.RealMaxAtmosphereAltitude();
mainBody = body;
this.maxThrustAccel = _maxThrustAccel;
this.probableLandingSiteASL = _probableLandingSiteASL;
this.probableLandingSiteRadius = _probableLandingSiteASL + bodyRadius;
referenceFrame = ReferenceFrame.CreateAtCurrentTime(_initialOrbit.referenceBody);
orbitReenters = OrbitReenters(_initialOrbit);
if (orbitReenters)
startUT = _UT;
maxDragGees = 0;
deltaVExpended = 0;
trajectory = new List<AbsoluteVector>();
simCurves = _simcurves;
once = true;
}
示例3: DistanceToTarget
static void DistanceToTarget(double[] x, double[] fi, object obj)
{
OptimizerData data = (OptimizerData)obj;
double t = data.original_UT + x[3];
Vector3d DV = new Vector3d(x[0], x[1], x[2]);
Orbit orbit = new Orbit();
orbit.UpdateFromStateVectors(data.initial_orbit.getRelativePositionAtUT(t), data.initial_orbit.getOrbitalVelocityAtUT(t) + DV.xzy, data.initial_orbit.referenceBody, t);
orbit.StartUT = t;
var pars = new PatchedConics.SolverParameters();
Vector3d pos;
while(true)
{
Orbit next_orbit = new Orbit();
PatchedConics.CalculatePatch(orbit, next_orbit, orbit.StartUT, pars, null);
if (orbit.EndUT > data.UT_arrival)
{
pos = orbit.getTruePositionAtUT(data.UT_arrival);
Vector3d err = pos - data.pos_arrival;
fi[0] = err.x;
fi[1] = err.y;
fi[2] = err.z;
return;
}
// As of 0.25 CalculatePatch fails if the orbit does not change SoI
if (next_orbit.referenceBody == null)
{
next_orbit.UpdateFromOrbitAtUT(orbit, orbit.StartUT + orbit.period, orbit.referenceBody);
}
orbit = next_orbit;
}
}