how to join highlighted points by curve in 3D

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.

 Akzeptierte Antwort

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 Kommentare

Aniket Patil
Aniket Patil am 25 Nov. 2019
how i convert this program so that same program i can use in SCILAB.
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).
Aniket Patil
Aniket Patil am 27 Nov. 2019
thank you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Polar Plots finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by