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.
0 个评论
采纳的回答
Thiago Henrique Gomes Lobato
2019-11-24
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*')
3 个评论
Thiago Henrique Gomes Lobato
2019-11-26
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!