how to join highlighted points by curve in 3D

1 次查看(过去 30 天)
I want to join two highlighted points using curve.the radius of bottom spiral is small than other spirals.So, we need to jont highlighed points using a curve who's radis will gradually increase.

采纳的回答

Thiago Henrique Gomes Lobato
For you to join those points with a radius that will gradually increase you first need to define what exactly is "gradually increase". For your case, however, it seems that what you want is to fullfill the spiral in a reasonable way, for this you can define an analytical spiral model (check for example: http://mathworld.wolfram.com/LogarithmicSpiral.html), get the parameters that define it and then interpolate in between points. This can be done as follows:
P1 = [36.05,0,20];
P2 = [-43.603,33.523,22];
[th1,r1,z1] = cart2pol(P1(1),P1(2),P1(3));
[th2,r2,z2] = cart2pol(P2(1),P2(2),P2(3));
% Logarithmic spiral Parameters ( r = a*exp(b*theta))
a = r1; % Simplyfication since th1 = 0
b = log(r2/(a))/th2;
thetas = linspace(th1,th2,10);
zs = linspace(z1,z2,10); % Linear z
Rs = a*exp(b*thetas);
[x,y,z] = pol2cart(thetas,Rs,zs);
plot3(x,y,z),hold on
plot3(P1(1),P1(2),P1(3),'r*')
plot3(P2(1),P2(2),P2(3),'r*')
untitled.jpg
  3 个评论
Thiago Henrique Gomes Lobato
I don't know SCILAB but it should be actually pretty straight forward. The only functions that may be missing are the coordinate conversions which you can easily find online (indeed the Matlab documentation page for them has the implementation in the Algorithms section).

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by