matrix_rotate_arbitrary_axis
Library to generate rotation matrix around arbitrary axis.
Original implementation of RotationMatrix class (matrix_rotate_arbitrary_axis.dart) by Glenn Murray.
Null-safety enabled.
Usage
If you want to apply rotation matrix to canvas in Flutter you can just call:
// Build a rotation matrix for rotations about the line through (a, b, c)
// parallel to [uUn, vUn, wUn] by the angle theta.
final rotationMatrix = RotationMatrix(a, b, c, uUn, vUn, wUn, angleInRadians);
final matrix = rotationMatrix.matrix;
canvas.transform(matrix2);
The parameters are:
ax-coordinate of a point on the line of rotation.by-coordinate of a point on the line of rotation.cz-coordinate of a point on the line of rotation.uUnx-coordinate of the line's direction vector (unnormalized).vUny-coordinate of the line's direction vector (unnormalized).wUnz-coordinate of the line's direction vector (unnormalized).thetaThe angle of rotation, in radians.
Example
See example in the example folder

Tests
To run tests:
dart --enable-experiment=non-nullable pub get
dart --enable-experiment=non-nullable pub run test