public static double Distance(MVector3D first, MVector3D second) { return Math.Sqrt( Square(first.X - second.X) + Square(first.Y - second.Y) + Square(first.Z - second.Z)); }
private void AssignJoints(Dictionary<xn.SkeletonJoint, xn.SkeletonJointPosition> dictionary) { this.Head = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.Head); this.Neck = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.Neck); this.Torso = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.Torso); this.LeftShoulder = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.LeftShoulder); this.LeftElbow = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.LeftElbow); this.LeftHand = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.LeftHand); this.RightShoulder = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.RightShoulder); this.RightElbow = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.RightElbow); this.RightHand = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.RightHand); this.LeftHip = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.LeftHip); this.LeftKnee = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.LeftKnee); this.LeftFoot = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.LeftFoot); this.RightHip = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.RightHip); this.RightKnee = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.RightKnee); this.RightFoot = this.GetVectorFromJoint(dictionary, xn.SkeletonJoint.RightFoot); }
public static double Distance(MVector3D first, MVector3D second, Func<MVector3D, double> selector) { return Math.Abs(selector(first) - selector(second)); }