Created
September 7, 2011 07:26
-
-
Save DfKimera/1199967 to your computer and use it in GitHub Desktop.
Tester for BallisticSimulationDLL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using BallisticSimulationDLL; | |
namespace BallisticSimulationDLL_Tester { | |
class Program { | |
static void Main(string[] args) { | |
Console.WriteLine("Iniciando simulação..."); | |
Simulation simulation = new Simulation(2000); // max. 2000 iterações | |
simulation.GravitationalAcceleration = 9.806f; | |
simulation.EarthRadius = 6400000f; | |
simulation.Space = 0f; | |
simulation.InitialSpeed = 0.01f; | |
simulation.InitialAltitude = 0; | |
simulation.ProjectPressure = 101325f; | |
simulation.BurnTime = 7.1665f; | |
simulation.InitialMass = 0.6f; | |
simulation.PropellentMass = 0.145f; | |
simulation.RocketDiameter = 0.04f; | |
simulation.Simulate(); | |
try { | |
SimulationResults results = simulation.getResults(); | |
Console.WriteLine("---------------------"); | |
Console.WriteLine("t \ts \tv \tdv \th \tm \tgama"); | |
Console.WriteLine("---------------------"); | |
foreach(SimulationIteration iteration in results.Iterations) { | |
Console.Write(iteration.t); | |
Console.Write(iteration.s); | |
Console.Write(iteration.v); | |
Console.Write(iteration.dv); | |
Console.Write(iteration.h); | |
Console.Write(iteration.m); | |
Console.Write(iteration.gama); | |
Console.Write("\r\n"); | |
} | |
} catch (Exception ex) { | |
Console.WriteLine("[!] Ocorreu um erro ao executar a simulação: " + ex.Message); | |
return; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment