How do I get the angle between three points input by ginput() in appdesigner?

1 次查看(过去 30 天)
[x, y] = ginput(3);
app.UIFigure.HandleVisibility = fhv;
x = round(x);
y = round(y);
I received the input with ginput(), but I don't know how to convert it to angle.
(R2022b)

采纳的回答

David Hill
David Hill 2022-11-30
编辑:David Hill 2022-11-30
z=[x,y];
d=diff(z);
Angle=acos(dot(-d(1,:),d(2,:))/norm(d(1,:))/norm(d(2,:)));
  1 个评论
채호 박
채호 박 2022-11-30
Thank you so much. I just have a few questions.
If I receive input from ginput(6) and the angle between the first three points is angle1, then the angle between the third points is angle2
z=[x,y];
d=diff(z);
app.angle1=acos(dot(-d(1,:),d(2,:))/norm(d(1,:))/norm(d(2,:)));
app.angle2=acos(dot(-d(4,:),d(5,:))/norm(d(4,:))/norm(d(5,:)));
Is it right?
+) If I use angle1, 'Use app.angle1 to reference app properties' appears. Is this correct?
properties (Access = private)
angle1
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Exploration 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by