fabien van mook

all packages "fvm-*"

package "fvm-geometry"

function file "rotationmat3Dcoord.m"

Function R = rotationmat3Dcoord(alpha,ordre)

creates the matrix for rotation by alphax around the x-axis, 
alphay around the y-axis, and alphaz around the z-axis. The
rotations are done in the given ordre.

Given a point by vector [x y z]. Using the expanded column vector
for it:
  P = [x; y; z; 1]
The coordinates of the point after rotation, are given by the
expanded column vector Q, by calculation with the matrix of rotation R:
  Q = R * P

The input variable alpha = [alphax alphay alphaz] gives the
rotation angles in degrees.
A positive alphaA yields a rotation counter-clockwise, seen from
a positive infinity position on the A-axis, for A = "x", "y" or "z".
 
The input variable ordre is a 3-element vector, indicating
along which axis the rotation is applied first, second or third. 
A zero in the variable indicates that no rotation along the 
respective axis is applied. If for example only a rotation 
along the z-axis is applied, one types:
  ordre = [0 0 1] 
(and then alphax and alphay are ignored).

Try also:
  demo rotationmat3Dcoord

Reference:
  Section "3. 3D Coordinate axes rotation matrices" from:
  "Rotation About an Arbitrary Axis in 3 Dimensions" by:
  Glenn Murray
  June 6, 2013

  http://inside.mines.edu/fs_home/gmurray/ArbitraryAxisRotation/
  visited 20160219

(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-geometry" under GNU GPLv3+