Borrar filtros
Borrar filtros

how to join highlighted points by curve in 3D

1 visualización (últimos 30 días)
Aniket Patil
Aniket Patil el 24 de Nov. de 2019
Comentada: Aniket Patil el 27 de Nov. de 2019
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.

Respuesta aceptada

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato el 24 de Nov. de 2019
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 comentarios
Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato el 26 de Nov. de 2019
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 el 27 de Nov. de 2019
thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by