public override TVector RightParts(TVector X, double t) { double mus = 132712440018; TVector objectVector = new TVector(X.Vector.Take(X.Length() - 6).ToArray()); TVector earthVector = new TVector(X.Vector.Skip(X.Length() - 6).ToArray()); TVector bufDecoratedRP = decorated.RightParts(objectVector, t); TVector bufEarthRP = earth.RightParts(earthVector, t); TVector HelioVector = Converter.GeoToHelio(objectVector.Take(3), earthVector.Take(3)); double distance = HelioVector.Norm(); double R = Math.Pow(earthVector.Take(3).Norm(), 3); for (int i = 3; i < 6; i++) { bufDecoratedRP[i] += mus * (HelioVector[i - 3] / Math.Pow(distance, 3) - (earthVector[i - 3] / R)); } return(bufDecoratedRP.Concat(bufEarthRP)); }
public override TVector RightParts(TVector X, double t) { var result = new double[X.Length()]; for (int i = 0; i < result.Length; i++) { result[i] = i < 3 ? X[i + 3] : -mu * X[i - 3] / Math.Pow(Math.Sqrt(X[0] * X[0] + X[1] * X[1] + X[2] * X[2]), 3); } return(new TVector(result)); }
public override TVector RightParts(TVector X, double t) { double muMoon = 4902.8000; TVector objectVector = new TVector(X.Vector.Take(X.Length() - 6) .ToArray()); TVector moonVector = new TVector(X.Vector.Skip(X.Length() - 6) .Take(6) .ToArray()); TVector bufDecoratedRP = decorated.RightParts(objectVector, t); TVector bufMoonRP = moon.RightParts(moonVector, t); TVector delta = moonVector.Take(3) - objectVector.Take(3); double R = moonVector.Take(3).Norm(); double distance = delta.Norm(); for (int i = 3; i < 6; i++) { bufDecoratedRP[i] += muMoon * (delta[i - 3] / Math.Pow(distance, 3) - moonVector[i - 3] / Math.Pow(R, 3)); } return(bufDecoratedRP.Concat(bufMoonRP)); }
// Сумма векторов public TVector Sum(TVector Vector2) { TVector ResultVector; double[] result = new double[Vector.Length]; if (result.Length == Vector2.Length()) { for (int i = 0; i < result.Length; i++) { result[i] = Vector[i] + Vector2.Vector[i]; } } ResultVector = new TVector(result); return(ResultVector); }