function showTwo3DCoordinateSystemsWithAngleDifference()
clear all
close all
origin1 = [0 0 0];
x_axis1 = [1 0 0];
y_axis1 = [0 1 0];
z_axis1 = [0 0 1];
theta_x = 30 * pi / 180;
rotation_matrix_x = [1 0 0; 0 cos(theta_x) -sin(theta_x); 0 sin(theta_x) cos(theta_x)];
theta_y = 45 * pi / 180;
rotation_matrix_y = [cos(theta_y) 0 sin(theta_y); 0 1 0; -sin(theta_y) 0 cos(theta_y)];
x_axis2 = rotation_matrix_x * rotation_matrix_y * [1 0 0]';
y_axis2 = rotation_matrix_x * rotation_matrix_y * [0 1 0]';
z_axis2 = rotation_matrix_x * rotation_matrix_y * [0 0 1]';
origin2 = [0 0 0];
figure;
hold on;
quiver3(origin1(1), origin1(2), origin1(3), x_axis1(1), x_axis1(2), x_axis1(3), 'r');
quiver3(origin1(1), origin1(2), origin1(3), y_axis1(1), y_axis1(2), y_axis1(3), 'g');
quiver3(origin1(1), origin1(2), origin1(3), z_axis1(1), z_axis1(2), z_axis1(3), 'b');
quiver3(origin2(1), origin2(2), origin2(3), x_axis2(1), x_axis2(2), x_axis2(3), 'r--');
quiver3(origin2(1), origin2(2), origin2(3), y_axis2(1), y_axis2(2), y_axis2(3), 'g--');
quiver3(origin2(1), origin2(2), origin2(3), z_axis2(1), z_axis2(2), z_axis2(3), 'b--');grid on;
xlabel('X');
ylabel('Y');
zlabel('Z');
title('具有角度差的两个三维坐标系显示');
legend('第一个坐标系 X 轴', '第一个坐标系 Y 轴', '第一个坐标系 Z 轴', '第二个坐标系 X 轴', '第二个坐标系 Y 轴', '第二个坐标系 Z 轴');end