function [ R ] = RandomRotationMatrix()
% Each column of a rotation matrix can be thought of as the x, y and
% z-axis of some reference frame placed with some orientation.
% We set x-axis to be a random 3D unit vector.
x_axis = rand(3,1)-0.5;
x_axis = x_axis/norm(x_axis);
% Then, we generate y-axis by finding a vector that is perpendicular to
% the x-axis. This is done by generating another random 3D unit vector
% and then computing the cross product with the x-axis.
y_axis = cross(x_axis, rand(3,1)-0.5);
y_axis = y_axis/norm(y_axis);
% z-axis must be the cross product of x-axis and y-axis.
z_axis = cross(x_axis, y_axis);
z_axis = z_axis/norm(z_axis);
R = [x_axis, y_axis, z_axis];
end
没有合适的资源?快使用搜索试试~ 我知道了~
随机旋转矩阵附matlab代码.zip
共1个文件
m:1个
需积分: 5 0 下载量 149 浏览量
2023-07-31
06:58:18
上传
评论
收藏 959B ZIP 举报
温馨提示
随机旋转矩阵附matlab代码.zip
资源推荐
资源详情
资源评论
收起资源包目录
随机旋转矩阵附matlab代码.zip (1个子文件)
随机旋转矩阵附matlab代码
RandomRotationMatrix.m 778B
共 1 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7259
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功