コード例 #1
0
 public Bone(double mass, Joint joint1, Joint joint2) : base(mass)
 {
     this.joint1 = joint1;
     this.joint2 = joint2;
     defLength   = Math.Sqrt(Math.Pow(joint1.getPosition().X - joint2.getPosition().X, 2) + Math.Pow(joint1.getPosition().Y - joint2.getPosition().Y, 2));
     length      = defLength;
 }
コード例 #2
0
 public void updateLength()
 {
     length = Math.Sqrt(Math.Pow(joint1.getPosition().X - joint2.getPosition().X, 2) + Math.Pow(joint1.getPosition().Y - joint2.getPosition().Y, 2));
 }