I want to figure out why sin(theta/2)=sqrt(1-quaternion.w^2)
here is part of my code to conver quaternion to rotation vector
m = ( acos(w)*2.0 )/sqrt(1-q.w*q.w);
data[0] = q.x*m;
data[1] = q.y*m;
data[2] = q.z*m;
I wrote it 2 years ago and I do not remember everything where it comes from.
From this site i know that 'm' should be 'sin(theta/2)' but in my code exist 'sqrt(1-w*w)'. For sure I checked everything in excel and it look like it's true. But my question is where it may come from that replacement? I dig many sites and I can not find my source of that part or any proof if it's true. I'm not good at mathemathics and programming, I just do it for hobby.