public void TestSerialize() { Stabilizer model = new Stabilizer().LoadDefaultHorizontal(); var json = Newtonsoft.Json.JsonConvert.SerializeObject(model); Console.WriteLine(json); }
public override Helicopter LoadDefault() { Mass = 2450; Inertia = Matrix <double> .Build.DenseOfArray(new double[, ] { { 1762, 0, 1085 }, { 0, 9167, 0 }, { 1085, 0, 8687 } }); MainRotor = new Rotor().LoadDefault(); MainRotor.Translation = Vector <double> .Build.DenseOfArray(new double[] { 0.0071, 0, -1.5164 }); MainRotor.Rotation = Matrix <double> .Build.RotationY(-6.3 *Math.PI / 180.0); TailRotor = new Rotor().LoadDefaultTailRotor(); TailRotor.Translation = Vector <double> .Build.DenseOfArray(new double[] { -7.5, 0, -0.8001 }); TailRotor.Rotation = Matrix <double> .Build.DenseOfArray(new double[, ] { { 1, 0, 0 }, { 0, 0, -1 }, { 0, 1, 0 } }); HorizontalStabilizer = new Stabilizer().LoadDefaultHorizontal(); HorizontalStabilizer.Translation = Vector <double> .Build.DenseOfArray(new double[] { -5.8, 0, -0.5 }); HorizontalStabilizer.Rotation = Matrix <double> .Build.RotationY(5 *Math.PI / 180.0); VerticalStabilizer = new Stabilizer().LoadDefaultVertical(); VerticalStabilizer.Translation = Vector <double> .Build.DenseOfArray(new double[] { -7.3, 0, -1.5 }); VerticalStabilizer.Rotation = Matrix <double> .Build.RotationX(90 *Math.PI / 180.0) * Matrix <double> .Build.RotationY(5 *Math.PI / 180.0); Fuselage = new Fuselage().LoadDefault(); Fuselage.Translation = Vector <double> .Build.DenseOfArray(new double[] { 0.0178, 0, 0.0127 }); FCS = new FlightControlSystem().LoadDefault(); Engine = new Engine().LoadDefault(); GearBox = new GearBox().LoadDefault(); return(this); }