private static float ChangeInMotion(Dictionary <JointType, Joint> currentJoints, Dictionary <JointType, Joint> prevJoints) { float totalDistance = 0; foreach (JointType type in Enum.GetValues(typeof(JointType))) { totalDistance += LinearAlgebra.DistanceBetweenTwoPoints(currentJoints[type].Position, prevJoints[type].Position); } float result = totalDistance / 25; return(result); }
private List <float> GetAnkleDistancesFromEachOther(JointsList jointsList) { var footDistances = new List <float>(); foreach (var joints in jointsList) { CameraSpacePoint leftAnkle = joints[JointType.AnkleLeft].Position; CameraSpacePoint rightAnkle = joints[JointType.AnkleRight].Position; float footDist = LinearAlgebra.DistanceBetweenTwoPoints(leftAnkle, rightAnkle); footDistances.Add(footDist); } return(footDistances); }