Example #1
0
 public static Joint Subtract(Joint a, Joint b)
 {
     return new Joint(a.Pos - b.Pos, a.Angle - b.Angle);
 }
Example #2
0
 public static Joint Multiply(Joint a, double t)
 {
     return new Joint(a.Pos * t, a.Angle * t);
 }
Example #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);
 }
Example #4
0
 public static Joint Add(Joint a, Joint b)
 {
     return new Joint(a.Pos + b.Pos, a.Angle + b.Angle);
 }