Quat a(1, 0, 0, 0); Quat b(0, 1, 0, 0); Quat c = a * b; // c = <0, 1, 0, 0>
Quat x(0, 1, 0, 0); Vector3d v(0, 1, 0); Vector3d result = x.rotate(v); // result = <0, 0, -1>In this example, we create a quaternion `x` which represents a 90-degree rotation around the x-axis. We also create a vector `v` with components (0, 1, 0). We then call the `rotate` method on `x` with `v` as an argument. The resulting vector `result` represents `v` after being rotated by `x`. The resulting vector is (0, 0, -1), which is the same as `v` rotated 90 degrees around the x-axis. The Quat library appears to be an open-source library written in C++ that provides a quaternion class and associated operations.