简体   繁体   English

3D圆周运动Matlab

[英]3D circular motion Matlab

I'm coding circular motion in Matlab , what is the appropriate formula or technique for circular motion in 3D-space , however I make this phenomena by the circle equation of sin and cos but it just rotates the object in circular motion (object itself) without taking its center , I want rotation with center of circle . 我正在Matlab中编写圆周运动的代码,什么是3D空间中圆周运动的合适公式或技术,但是我通过sin和cos的圆周方程产生了这种现象,但它只是使对象以圆周运动旋转(对象本身)不以中心为中心 ,我想以圆心为中心旋转。

My Code: 我的代码:

for ii = 1:3

circular motion = [5*sin(ii) 5 5*cos(ii)];
%I used gain of 5 in order to give its speed.
%matrix circular motion contains XYZ coordinates.

end

Real life scenario of circular motion about center of circle: 关于圆心的圆周运动的现实场景: 直升机

Any suggestions or piece of formula that makes my strings unique are welcomed. 欢迎提出使我的琴弦与众不同的任何建议或公式。

Assuming I understand your requirement correctly, to draw a circle in 3 dimensions, you would need to specify the plane on which the circle rests. 假设我正确理解了您的要求,要绘制3个尺寸的圆,则需要指定圆所在的平面。 Let me assume that the plane is z=1 plane. 让我假设该平面是z=1平面。

So, you could plot a circle using: 因此,您可以使用以下方法绘制一个圆:

t = 0:0.01:2*pi;
plot3(sin(t),cos(t),ones(size(t)));

Which gives this: 这给出了:

在此处输入图片说明


Bonus: 奖金:

For a cool animation, try doing: 对于很酷的动画,请尝试执行以下操作:

t = 0:0.01:2*pi;
comet3(sin(t),cos(t),ones(size(t)));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM