Scalar product
Y = scalar_product(A, B)
scalar_product(A, B) computes the scalar product of two quaternion arrays, elementwise on the components.
The scalar product of two quaternions is the sum of the products of their respective components. It is defined for both pure and full quaternions and in both cases can also be defined as the product of the moduli multiplied by the cosine of the angle between the two quaternions (in 3-space for pure quaternions, 4-space for full quaternions). The scalar product of perpendicular quaternions is zero.
The two operands must be of the same size.
For the inner product of two quaternion vectors, see the MATLAB® function dot which works for quaternions.
>> scalar_product(qi, qj) ans = 0