【问题标题】:Arc between two 3d vectors两个 3d 向量之间的弧
【发布时间】: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 中从哪里开始。有没有人能告诉我如何找到零角。

【问题讨论】:

    标签: matlab vector 3d plot


    【解决方案1】:

    简短回答,使用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
    

    【讨论】:

    • 谢谢,但它在 MuPad 中不起作用。 Mb 你知道怎么做吗?
    • 对不起,我没有用过MuPad,今天不能花太多时间研究stackoverflow。祝你好运。
    猜你喜欢
    • 1970-01-01
    • 2018-04-29
    • 2017-08-08
    • 1970-01-01
    • 2017-03-22
    • 2022-08-17
    • 1970-01-01
    • 2019-11-08
    • 1970-01-01
    相关资源
    最近更新 更多