math_rot_matrix3d: 3d rotation matrix

View source: R/math.R

math_rot_matrix3dR Documentation

3d rotation matrix

Description

Calculates a 3D rotation matrix for a given rotation axis x(unit vector) and an angle angle. The rotation will be applied by the right hand rule.

Usage

math_rot_matrix3d(x, angle)

Arguments

x

unit vector c(x1,x2,x3) defining the rotation axis

angle

in radiant

Details

https://en.wikipedia.org/wiki/Rotation_matrix https://de.wikipedia.org/wiki/Drehmatrix#Drehmatrizen_des_Raumes_%E2%84%9D%C2%B3

Value

Returns 3D rotation matrix for given axis (unit vector) and angle.

Author(s)

Florian Wagner florian.wagner@wagnius.ch

Examples

math_rot_matrix3d(matrix(c(0,0,1)),0.5)
matrix(c(1,2,3))|>
  math_unit_vector()|>
  math_rot_matrix3d(-pi)
math_rot_matrix3d(matrix(c(0,0,1)),0.5)|>
  det()

wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.