daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void TestGetJointPositions(double shoulder, double elbow, double wrist, double palmEndX, double palmEndY)
  2.         {
  3.             var joints = AnglesToCoordinatesTask.GetJointPositions(shoulder, elbow, wrist);
  4.             Assert.AreEqual(palmEndX, joints[2].X, 1e-5, "palm endX");
  5.             Assert.AreEqual(palmEndY, joints[2].Y, 1e-5, "palm endY");
  6.             Assert.AreEqual(Manipulator.UpperArm, GetDistance(new PointF(0, 0), joints[0]));
  7.             Assert.AreEqual(Manipulator.Forearm, GetDistance(joints[0], joints[1]));
  8.             Assert.AreEqual(Manipulator.Palm, GetDistance(joints[1], joints[2]));
  9.         }
  10.  
  11.         double GetDistance(PointF firstPoint, PointF secondPoint)
  12.         {
  13.             var dX = firstPoint.X - secondPoint.X;
  14.             var dY = firstPoint.Y - secondPoint.Y;
  15.             return Math.Sqrt(dX * dX + dY * dY);
  16.          }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top