Ejemplo n.º 1
0
        /// <summary>
        /// Builds simulation object from all the user's inputs
        /// </summary>
        private void buildSimulation()
        {
            //Bullet:
            double         mass           = Convert.ToDouble(this.m.Text);
            double         velocity       = Convert.ToDouble(this.Vo.Text);
            double         xAngle         = Convert.ToDouble(this.theta1.Text);
            double         yAngle         = Convert.ToDouble(this.theta2.Text);
            VelocityVector velocityVector = new VelocityVector();

            velocityVector.defineByAngles(xAngle, yAngle, velocity);
            double ressistance = Convert.ToDouble(this.k.Text);
            //Wind:
            Wind wind = new Wind();

            if (this.useWind.CheckState == CheckState.Unchecked)
            {
                wind.Velocity = 0;
            }
            //Target:
            double radius   = Convert.ToDouble(this.radius.Text);
            double distance = Convert.ToDouble(this.distance.Text);

            //Build Simulation object:
            this.simulation = new Simulation(new Bullet(mass, ressistance, velocityVector),
                                             wind, new Target(distance, radius));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Bullet constractor
 /// </summary>
 /// <param name="mass">get the values for mass</param>
 /// <param name="ressistance">get the values for ressistamce</param>
 /// <param name="velocityVector">get the values for velocity vector</param>
 public Bullet(double mass, double ressistance, VelocityVector velocityVector)
 {
     this.mass           = mass;
     this.ressistance    = ressistance;
     this.velocityVector = velocityVector;
 }