connect two points on sphere

3 visualizzazioni (ultimi 30 giorni)
Mari Alqarni
Mari Alqarni il 29 Mar 2016
Modificato: Mari Alqarni il 1 Apr 2016
I want to connect at least 2 points on a sphere. The first point is at north pole (0,0,1). I am struggling with how to connect these successive points using the loop. I appreciate your help. Here is how I start:
wx0=0;
wy0=0;
wz0=1;
w0=[wx0;wy0;wz0];% initial position at north pole
% use the vector in spherical coordinates to update the position
%w=[sin(theta)*cos(phi);sin(theta)*sin(phi);cos(theta)];
where theta is the angle that w makes with the z axis and is between zero and pi. phi is the angle that the projection of w in xy plane makes with x axis and it is between zero and 2 pi. So the initial angles are theta=0 and phi=0 because I am at the north pole. The angles will be updated by solving a system of ODE and then use the solution to locate w position (say w1) then obtain new theta and phi and substitute in w to locate w2 (second point that I need to move to) an so on. Suppose I want to move 100 points from the north pole ( my initial position) so I need to use for loop to obtain the w1 , w2 ,..., w100. From this point, I do not know how to proceed.
  2 Commenti
Geoff Hayes
Geoff Hayes il 29 Mar 2016
Mari - you may want to show your code so that we can get a better idea of what you are trying to attempt.
Geoff Hayes
Geoff Hayes il 31 Mar 2016
Modificato: Geoff Hayes il 31 Mar 2016
Mari - what are phi and theta? Also, where is the loop that you mention in your question? Why is it necessary?

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by