Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double rotx1 = -((t[2] * t1[1] - t1[2] * t[1]) / (t1[1] * t1[1] + t1[2] * t1[2]));
- double rotx11 = Math.Asin(rotx1) / Math.PI * 180;
- double roty1 = -((t[2] * t1[0] - t1[2] * t[0]) / (t1[0] * t1[0] + t1[2] * t1[2]));
- double roty11 = Math.Asin(roty1) / Math.PI * 180;
- double rotz1 = -((t[1] * t1[0] - t1[1] * t[0]) / (t1[0] * t1[0] + t1[1] * t1[1]));
- double rotz11 = Math.Asin(rotz1) / Math.PI * 180;
- Console.WriteLine("X=" + Convert.ToString(rotx11) + " Y=" +
- Convert.ToString(roty11) + " Z=" + Convert.ToString(rotz11));
- double[] pos = { 395, -0, 37, 90, 90, 0 };//The coordinates of the first marker.
- double[] pos1 = { 321, -0, 37, 90, 90, 0 };//The coordinates of the second marker.
- double[] t = { 0, 0, 0, 0, 0, 0 };
- double[] t1 = { 0, 0, 0, 0, 0, 0 };
- double[] t2= { 0, 0, 0, 0, 0, 0 };
- double x = -45.5;//Known changes in the coordinates of the point of the first marker
- double y = 59;
- double z = 33 ;
- double x1 = -38.5;// Known changes in the coordinates of the point of the second marker
- double y1 = 40.5;
- double z1 = 54;
- t[0] = pos[0] + x;
- t[1] = pos[1] + y;
- t[2] = pos[2] -4;
- t[3] = pos[3];
- t[4] = pos[4];
- t[5] = pos[5];
- t1[0] = pos1[0] + x1;
- t1[1] = pos1[1] + y1;
- t1[2] = pos1[2] + 17;
- t1[3] = pos1[3];
- t1[4] = pos1[4];
- t1[5] = pos1[5];
- double Ayx21 = Math.Atan2(t[1] - t1[1], t[0] - t1[0]) / Math.PI * 180;
- double rotx = Math.Atan2(t[1] - t1[1], t[2] - t1[2]);
- double roty1111 = -Math.Atan2((t[2] - t1[2]) * Math.Cos(rotx), (t[1] - t1[1]));
- double rotz = Math.Atan2(Math.Sin(roty1111), Math.Sin(rotx) * Math.Cos(rotx)) / Math.PI * 180;
- double rotx11111 = (rotz) - (Ayx21);
- double roty = -Math.Atan2((t[2] - t1[2]) * Math.Cos(rotx), (t[1] - t1[1])) / Math.PI * 180;
- t2[0] = pos[0] + x;
- t2[1] = pos[1] + y;
- t2[2] = pos[2] + z ;//убрать потом -37
- t2[3] = (rotx11111);
- t2[4] = (90 + roty);
- t2[5] = (180 + rotz);
- string position1 = Convert.ToString(t2[0]).Replace(',', '.');
- string position2 = Convert.ToString(t2[1]).Replace(',', '.');
- string position3 = Convert.ToString(t2[2]).Replace(',', '.');
- string angle1 = Convert.ToString(t2[3]).Replace(',', '.');
- string angle2 = Convert.ToString(t2[4]).Replace(',', '.');
- string angle3 = Convert.ToString(t2[5]).Replace(',', '.');
- Console.WriteLine("[" + Convert.ToString(position1) + "," + Convert.ToString(position2) + "," + Convert.ToString(position3) + "," + Convert.ToString(angle1) + "," + Convert.ToString(angle2) + "," + Convert.ToString(angle3) + "]");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement