#include #include "ballistiksimulator.h" #include "trajectorywarp.h" #include "trajectorywidget.h" #include Curve trajectoryPointsToCurve(const QVector& trajectory, const QVector3D& color) { Curve curve; curve.color = color; curve.points.reserve(trajectory.size()); for (const auto& p : trajectory) { curve.points.append(p.position); } return curve; } int main(int argc, char *argv[]) { QApplication app(argc, argv); BallistikSimulator sim; double v0 = 400.0; double winkel = 20.0; double masse = 0.015; double cw = 0.29; double flaeche = 0.00006; double praezision = 0.2; QVector original = sim.simuliereFlug(v0, winkel, masse, cw, flaeche, praezision); sim.speichereInCSV(0,original, "flugbahn.csv"); //------------------------------------------------------------- TrajectoryWidget widget; widget.resize(800, 600); widget.setWindowTitle("3D Trajectory Viewer"); QVector3D originalTarget = original.last().position; // Ziel streuen QVector3D newTarget = originalTarget + QVector3D( 5.0, 5.0, 5.0); auto warped = TrajectoryWarp::warpToNewTarget(original, newTarget); sim.speichereInCSV(1,warped, "flugbahn.csv"); // Kurve 1 Curve c1 = trajectoryPointsToCurve(original, QVector3D(1, 1, 0)); // Kurve 2 Curve c2 = trajectoryPointsToCurve(warped, QVector3D(0, 1, 1)); QVector curves; curves.append(c1); curves.append(c2); widget.setCurves(curves); widget.show(); return app.exec(); }