connect two points on sphere

조회 수: 4 (최근 30일)
Mari Alqarni
Mari Alqarni 2016년 3월 29일
편집: Mari Alqarni 2016년 4월 1일
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
Geoff Hayes
Geoff Hayes 2016년 3월 29일
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 2016년 3월 31일
편집: Geoff Hayes 2016년 3월 31일
Mari - what are phi and theta? Also, where is the loop that you mention in your question? Why is it necessary?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by