User talk:T.j.cosimano

Welcome!
Hello, T.j.cosimano, and welcome to Wikipedia! Thank you for your contributions. I hope you like the place and decide to stay. Here are a few links to pages you might find helpful: Please remember to sign your messages on talk pages by typing four tildes ( ~ ); this will automatically insert your username and the date. If you need help, check out Questions, ask me on my talk page, or ask your question on this page and then place  before the question. Again, welcome!
 * Getting Started
 * Introduction to Wikipedia
 * The five pillars of Wikipedia
 * How to edit a page and How to develop articles
 * How to create your first article
 * Simplified Manual of Style

Quaternions and rotation
Thank you for the edit summary in. Really it is a good practice. Without any sarcasm.

am a Wikipedian with 20,000 edits and a mathematician since my childhood. And say you: you didn’t find anything wrong. Consider a rotation matrix
 * $$\begin{pmatrix}1&&0&&0 \\ 0&&0&&-1 \\ 0&&1&&0 \end{pmatrix}$$

Do you understand which rotation does it describe? By which angle?

Well. Now substitute it to your software, please. Which quaternion do you get? Incnis Mrsi (talk) 18:14, 21 January 2014 (UTC)

Thanks, I was not trying to cause any issues or anything. I just legitimately think I found an error. The matrix you put above is a -90 degree rotation about the x-axis. Bellow is an example of code that I am using that correctly will transform points between a set of test work-object/point pairs. I am using this in sci-lab and am getting the expected result. I appologize about the formatting. I am still new here. See bellow:

Points - TEST1:=[250.18,11.03,795.66],[0.005579,0.338157,0.018185,0.940898]; TEST2:=[483.71,-139.09,-253],[0.004476,0.358136,0.012604,0.933574]; TEST3:=[518.61,-120.61,-174.91],[0.005739,0.333578,0.010799,0.942643];

Work-Objects -

TEST1:=0,0,0],[1,0,0,0,0,0,0],[1,0,0,0; TEST2:=-244.175,151.615,1026.3],[0.999757,-0.005607,-0.021266,0.001253,0,0,0],[1,0,0,0]; TEST3:=-267.213,131.446,974.029],[0.99996,-0.00689934,0.00493966,0.00278355,-0.090271,-0.007287,0.002325],[1,-4E-06,3E-06,-0.000228];

clear all clc funcprot(0); function T = V2T(V) T = zeros(4,4); T(1,1) = 1 - 2*(V(6)^2) - 2*(V(7)^2); T(1,2) = 2*(V(5)*V(6) - V(7)*V(4)); T(1,3) = 2*(V(5)*V(7) + V(6)*V(4)); T(1,4) = V(1); T(2,1) = 2*(V(5)*V(6) + V(7)*V(4)); T(2,2) = 1 - 2*(V(5)^2) - 2*(V(7)^2); T(2,3) = 2*(V(6)*V(7) - V(5)*V(4)); T(2,4) = V(2); T(3,1) = 2*(V(5)*V(7) - V(6)*V(4)); T(3,2) = 2*(V(5)*V(4) + V(6)*V(7)); T(3,3) = 1 - 2*(V(5)^2) - 2*(V(6)^2); T(3,4) = V(3); T(4,1) = 0; T(4,2) = 0; T(4,3) = 0; T(4,4) = 1; endfunction function V = T2V(T) V = zeros(1,7); V(1) = T(1,4); V(2) = T(2,4); V(3) = T(3,4); V(4) = 1/2*sqrt(1+T(1,1)+T(2,2)+T(3,3)); V(5) = (T(3,2)+T(2,3))/(4*V(4)); V(6) = (T(1,3)-T(3,1))/(4*V(4)); V(7) = (T(2,1)-T(1,2))/(4*V(4)); endfunction O_FR = zeros(1,7); O_OB = zeros(1,7); O_PS = zeros(1,7); N_FR = zeros(1,7); N_OB = zeros(1,7); O_FR = [-267.213,131.446,974.029,0.99996,-0.00689934,0.00493966,0.00278355]; O_OB = [-0.090271,-0.007287,0.002325,1,-4E-06,3E-06,-0.000228]; O_PS = [518.61,-120.61,-174.91,0.005739,0.333578,0.010799,0.942643]; tmp_1 = O_PS(4); tmp_2 = O_PS(5); tmp_3 = O_PS(6); tmp_4 = O_PS(7); O_PS(4) = tmp_4; O_PS(5) = tmp_1; O_PS(6) = tmp_2; O_PS(7) = tmp_3; N_FR = [-244.175,151.615,1026.3,0.999757,-0.005607,-0.021266,0.001253] N_OB = [0,0,0,1,0,0,0] N = zeros(4,4); O = zeros(4,4); N = V2T(N_FR) * V2T(N_OB); O = V2T(O_FR) * V2T(O_OB); N_inv = zeros(4,4); N_inv = inv(N); N_PS = T2V(N_inv * O * V2T(O_PS)); tmp_1 = N_PS(4); tmp_2 = N_PS(5); tmp_3 = N_PS(6); tmp_4 = N_PS(7); N_PS(4) = tmp_2; N_PS(5) = tmp_3; N_PS(6) = tmp_4; N_PS(7) = tmp_1; disp(O_PS); disp(N_PS);

T.j.cosimano (talk) 19:36, 21 January 2014 (UTC)
 * So, did you substitute my rotation to “T2V”? guess V(1), V(2), V(3) are components of the translation vector and the quaternion should be $V(4) + V(5)i + V(6)j + V(7)k$ up to signs and the order of indices. Right? The calculation can be done in mind:
 * V(4) = 1/2√2; √2/2; (1 + 1 + 0 + 0 = 2)
 * V(5) = 0; (terms in the numerator annihilate)
 * V(6) = 0; (zeros in the numerator)
 * V(7) = 0; (zeros in the numerator)
 * Do you understand that it isn’t a ±90° rotation quaternion? Incnis Mrsi (talk) 20:29, 21 January 2014 (UTC)
 * Oops… I didn’t know that many programming languages have a counter-intuitive order of operations for “a/b*c”. Of course, I’d say “V(4) = 0.5*sqrt(…)” in my program. But it doesn’t matter. The absolute value of the quaternion differs from 1 anyway. Incnis Mrsi (talk) 21:02, 21 January 2014 (UTC)

T.j.cosimano (talk) 23:34, 21 January 2014 (UTC) : I think my sign switch was a coincidental compensation for truncation error. I am looking into ways to fix that now. Thank you for letting me bounce the ideas off of you even though that's not what you're there for! Also, the order of operations did not change anything. The syntax of this language is strange; I am also used to a more intuitive structure while coding. Cheers.