private void IncBinding2_Button_Click(object sender, EventArgs e) { if (TopMount_radioButton.Checked == true) { if (Object4.Get_Height() + 0.5f < Object2.Get_Height()) { Object4.Set_Height(Object4.Get_Height() + 0.5f); } } else { if (Object4.Get_Height() - 0.5f > Object1.Get_Height()) { Object4.Set_Height(Object4.Get_Height() - 0.5f); } } }
private void RenderTimer_Tick(object sender, EventArgs e) { DrawAllMatrix(); AngleValue_Label.Text = Convert.ToString(ChangeAngle_TrackBar.Value) + "°"; if (TopMount_radioButton.Checked == true) { label2.Text = Convert.ToString(Object1.Get_Height() / 10) + " м"; label3.Text = Convert.ToString(Object2.Get_Height() / 10) + " м"; label4.Text = Convert.ToString(Object3.Get_Height() / 10) + " м"; label5.Text = Convert.ToString(Object4.Get_Height() / 10) + " м"; } else { label2.Text = Convert.ToString(1 - Object1.Get_Height() / 10) + " м"; label3.Text = Convert.ToString(1 - Object2.Get_Height() / 10) + " м"; label4.Text = Convert.ToString(1 - Object3.Get_Height() / 10) + " м"; label5.Text = Convert.ToString(1 - Object4.Get_Height() / 10) + " м"; } }
private double f(double xt, double yt, double zt) { if (TopMount_radioButton.Checked == true) { float o1 = Object1.Get_Height() / 10; float o2 = Object2.Get_Height() / 10; float o3 = Object3.Get_Height() / 10; float o4 = Object4.Get_Height() / 10; L = o3 - (o1 + o2) / 2; I = 2 * 0.08 * 0.08 + M * Math.Pow((o1 - o3), 2) + M * Math.Pow((o2 - o3), 2); return(-G *M *L *Math.Sin(yt) / I); } else { float o1 = 1 - Object1.Get_Height() / 10; float o2 = 1 - Object2.Get_Height() / 10; float o3 = 1 - Object3.Get_Height() / 10; float o4 = 1 - Object4.Get_Height() / 10; L = o4 - (o1 + o2) / 2; I = 2 * 0.08 * 0.08 + Math.Pow((o1 - o4), 2) + Math.Pow((o2 - o4), 2); return(-G *L *Math.Sin(yt) / I); } }