Any commands about rotation where the unit of the input is radian
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Tony Cheng
el 9 de Jun. de 2025
Respondida: Paul
el 9 de Jun. de 2025
Hi there,
We find in Matlab, the command rotx denotes a rotation matrix around the x-axis by ang degrees, and the unit of the input is degree.
Here I want to ask, are there any commands that the unit of the input is radian?
Many thanks!
0 comentarios
Respuesta aceptada
the cyclist
el 9 de Jun. de 2025
I don't think there is a native equivalent of rotx() that uses radian as input. You can convert radians to degrees using the rad2deg function. You could write your own rotx_rad() function that incorporates that automatically.
function R = rotx_rad(theta_rad)
% Rotation matrix about the x-axis (input in radians)
% R = rotx_rad(theta_rad) returns the 3×3 rotation matrix for a rotation
% of theta_rad radians about the x-axis.
% Convert radians to degrees and call rotx()
R = rotx(rad2deg(theta_rad));
end
0 comentarios
Más respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!