【发布时间】:2012-02-28 17:12:21
【问题描述】:
如何在 3D Matlab 图中简单地制作带有标签的弧?我有两个 3D 向量(plot::Arrow3d),我想在它们之间命名一个角度,并在 3D 绘图上显示它。
编辑1: 我使用 MuPad 来渲染我的绘图,我想通过 plot::Arc3d(1, [0,0,0], n, al..bet) 在两个向量之间绘制弧线。其中 n 很容易找到。但我完全不明白弧角在 3D 中从哪里开始。有没有人能告诉我如何找到零角。
【问题讨论】:
如何在 3D Matlab 图中简单地制作带有标签的弧?我有两个 3D 向量(plot::Arrow3d),我想在它们之间命名一个角度,并在 3D 绘图上显示它。
编辑1: 我使用 MuPad 来渲染我的绘图,我想通过 plot::Arc3d(1, [0,0,0], n, al..bet) 在两个向量之间绘制弧线。其中 n 很容易找到。但我完全不明白弧角在 3D 中从哪里开始。有没有人能告诉我如何找到零角。
【问题讨论】:
简短回答,使用text 函数。
看看这是否能让你开始:
%A couple of random points in 3 space
xyz1 = randn(3,1);
xyz2 = randn(3,1);
%Set up a figure, and create "arrow" plots within
figure(3781);
clf;
hold on
quiver3(0,0,0,xyz1(1), xyz1(2), xyz1(3),0,'b')
quiver3(0,0,0,xyz2(1), xyz2(2), xyz2(3),0,'r')
view(3)
%Add a line connecting teh arrows, and a text label
plot3([xyz1(1) xyz2(1)], [xyz1(2) xyz2(2)], [xyz1(3) xyz2(3)],'k:')
xyzCenter = mean([xyz1 xyz2],2);
h = text(xyzCenter(1), xyzCenter(2), xyzCenter(3), 'Label text here');
set(h,'Color','b')
get(h); %For more properties to set
【讨论】: