def * (other)
if other.kind_of?(Quaternion)
Quaternion(@re*other.re-@im*other.im-@jm*other.jm-@km*other.km,
@re*other.im+@im*other.re+@jm*other.km-@km*other.jm,
@re*other.jm-@im*other.km+@jm*other.re+@km*other.im,
@re*other.km+@im*other.jm-@jm*other.im+@km*other.re)
elsif other.kind_of?(Complex)
Quaternion(@re*other.real - @im*other.image,
@re*other.image + @im*other.real,
@jm*other.real + @km*other.image,
@km*other.real - @jm*other.image)
elsif Complex.generic?(other)
Quaternion(@re * other, @im * other, @jm * other, @km * other)
else x , y = other.coerce(self); x * y
end
end