Write a class Quaternion that defines the four basic operations of quaternions and the two I/O operations. Quaternions, as defined in 1843 by William Hamilton and published in his Lectures on Quaternions in 1853, are an extension of complex numbers. Quaternions are quadruples of real numbers, (a,b,c,d) = a + bi + cj + dk, where 1 = (1,0,0,0), i = (0,1,0,0), j = (0,0,1,0), and k = (0,0,0,1) and the following equations hold:
i2 = j2 = k2 = –1ij = k, jk = i, ki = j, ji = –k, kj = –i, ik = –j (a + bi + cj + dk) + (p + qi + rj + sk) = (a + p) + (b + q)i + (c + r)j + (d + s)k (a + bi + cj + dk) · (p + qi + rj + sk) = (ap – bq – cr – ds) + (aq + bp + cs – dr)i + (ar + cp + dq – bs)j + (as + dp + br – cq)kUse these equations in implementing a quaternion class.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.