Beispiel #1
0
 public static Joint Subtract(Joint a, Joint b)
 {
     return new Joint(a.Pos - b.Pos, a.Angle - b.Angle);
 }
Beispiel #2
0
 public static Joint Multiply(Joint a, double t)
 {
     return new Joint(a.Pos * t, a.Angle * t);
 }
Beispiel #3
0
 /// <summary>
 /// Multiplies a child joint with a parent joint to create a new one.
 /// </summary>
 /// <param name='child'>
 /// The child joint to be transformed by parent.
 /// </param>
 /// <param name='parent'>
 /// Parent joint to transform child joint.
 /// </param>
 public static Joint Multiply(Joint child, Joint parent)
 {
     var transform = Matrix.Rotation(parent.Angle) * Matrix.Translation(parent.Pos.X, parent.Pos.Y);
     return new Joint(child.Pos.Transform(transform), parent.Angle + child.Angle);
 }
Beispiel #4
0
 public static Joint Add(Joint a, Joint b)
 {
     return new Joint(a.Pos + b.Pos, a.Angle + b.Angle);
 }