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