Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here you have your problem modeled and running with Mathematica. </p> <p>I used the "Levenberg-Marquardt" method. </p> <p>This is why I asked for your data. With MY data, YOUR problems are always going to be easier:)</p> <pre><code>xnew[x_, y_, z_] := RotationMatrix[rx, {1, 0, 0}].RotationMatrix[ ry, {0, 1, 0}].RotationMatrix[rz, {0, 0, 1}].{x, y, z} + {tx, ty, tz}; (* Generate Sample Data*) (* Angles 1/2,1/3,1/5 *) (* traslation -&gt; {1,2,3} *) (* Minimum mean Noise 5% *) data = Table[{{x, y, z}, RotationMatrix[1/2, {1, 0, 0}]. RotationMatrix[1/3, {0, 1, 0}]. RotationMatrix[1/5, {0, 0, 1}].{x, y, z} +{1, 2, 3} +RandomReal[{-.05, .05}, 3]}, {x, 0, 1, .1}, {y, 0, 1, .1}, {z, 0, 1, .1}]; data = Flatten[data, 2]; (* Now find the parameters*) FindMinimum[ Sum[SquaredEuclideanDistance[xnew[i[[1]] /. List -&gt; Sequence], i[[2]]], {i, data}] , {rx, ry, rz, tx, ty, tz}, Method -&gt; "LevenbergMarquardt"] </code></pre> <p>Out:</p> <pre><code>{3.2423, {rx -&gt; 0.500566, ry -&gt; 0.334012, rz -&gt; 0.199902, tx -&gt; 0.99985, ty -&gt; 1.99939, tz -&gt; 3.00021}} </code></pre> <p>(Within 1/1000 of the real values)</p> <p><b>Edit</b> </p> <p>I worked a little with your data.<br> The problem is that your system is very bad conditioned. You need much more data to effectively calculate such small rotations. </p> <p>These are the results I got: </p> <p>Rotations in degrees: </p> <pre><code>rx = 179.99999999999999999999984968493536659553226696793 ry = 180.00000000000000000000006934755799995159952661222 rz = 180.0006286861217378980724139120849587855611645627 </code></pre> <p>Traslations</p> <pre><code>tx = 48.503663696727576867196234527227830090575281353092 ty = 63.974139455057300403798198525151849767949596684232 tz = -0.99999999999999999999997957276716543927459921348549 </code></pre> <p>I should calculate the errors, but I've no time right now. </p> <p>BTW, rz = Pi + 0.000011 (in radians)</p> <p>HTH!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload