コード例 #1
0
ファイル: Form1.cs プロジェクト: j-runser/AdapterPattern
        private void ComputeImperial()
        {
            double v1 = Convert.ToDouble(txtBox_avgAccV1.Text);
            double v2 = Convert.ToDouble(txtBox_avgAccV2.Text);
            double t  = Convert.ToDouble(txtBox_avgAccT.Text);

            lbl_avgAccOut.Text = "" + Formulas.AverageAcceleration(v1, v2, t) + " f/s";

            v1 = Convert.ToDouble(txtBox_fallAccV.Text);
            t  = Convert.ToDouble(txtBox_fallAccT.Text);
            lbl_fallAccOut.Text = "" + Formulas.FallingAcceleration(v1, t) + " f/s";

            v1 = Convert.ToDouble(txtBox_vertDistV.Text);
            t  = Convert.ToDouble(txtBox_vertDistT.Text);
            lbl_projVertDistOut.Text = "" + Formulas.ProjectileVerticalDistance(v1, t) + " f";

            v1 = Convert.ToDouble(txtBox_horzDistV.Text);
            t  = Convert.ToDouble(txtBox_horzDistT.Text);
            lbl_projHorzDistOut.Text = "" + Formulas.ProjectileHorizontalDistance(v1, t) + " f";

            v1 = Convert.ToDouble(txtBox_vertVelV.Text);
            t  = Convert.ToDouble(txtBox_vertVelT.Text);
            lbl_projVertVelOut.Text = "" + Formulas.ProjectileVerticalVelocity(v1, t) + " f/s";
        }
コード例 #2
0
ファイル: Adapter.cs プロジェクト: j-runser/AdapterPattern
 public override double ProjectileVerticalDistance(double velocity, double time)
 {
     velocity = velocity * FOOT_PER_METER;
     return(Formulas.ProjectileVerticalDistance(velocity, time) * METER_PER_FOOT);
 }