I want to convert an
rgb color triplet to a quaternion
w + x*i + y*j + z*k.
I thought of it as of rotation, and (using axis-angle representation and Euclidian length of a unit quaternion equals 1) I came to following equation system:
w &= \sqrt(1-(x^2+y^2+z^2))\\
w &= \cos(\arcsin(r/x))\\
w &= \cos(\arcsin(g/y))\\
w &= \cos(\arcsin(b/z)).
Here $r, g, b$ are constants and i need to obtain $x, y, z, w$.
I am a bit stumped. On the one hand there are 4 variables and 4 equations. On the other hand... how can I solve this? Could this even be solved?