How to find 3 points in a sphere?

5 views (last 30 days)
Kuruvilla Joseph
Kuruvilla Joseph on 3 May 2021
I want to find 3 points on a sphere whose radius and centre is known. The points should form a circle on the sphere's surface. I am using peter corke robotics toolbox
  4 Comments
Adam Danz
Adam Danz on 3 May 2021
Edited: Adam Danz on 3 May 2021
Any 3 points or do you also know the azimuth and elevation of at least 2 of the points?
Kuruvilla Joseph
Kuruvilla Joseph on 3 May 2021
Any three points which form a circle on the sphere ,like a great circle

Sign in to comment.

Answers (1)

Adam Danz
Adam Danz on 4 May 2021
The question is: how to get any 3 points along a great circle on a sphere with known radius and center
Here's how I think of the problem.
Assume unit sphere with radius 1 centered at (0,0,0) and a great circle laying on the xy plane. The point to the far left, upward, and far right sections of the sphere are
xyzn = [-1 0 0; % left
0 1 0; % upper
1 0 0]; % right
Now all you have to do is scale it and shift it to the sphere's center.
r = 12; %radius
cnt = [-10,8,20]; % center points (x,y,z)
xyz = xyzn.*r + cnt
xyz = 3×3
-22 8 20 -10 20 20 2 8 20
xyz are 3 coordinates (row-wise) that lay on a great circle that lies on the xy plane passing through the center of the sphere.
Now let's plot it,
[sx,sy,sz] = sphere(20);
sx = sx*r+cnt(1);
sy = sy*r+cnt(2);
sz = sz*r+cnt(3);
mesh(sx,sy,sz,'LineWidth',2,'FaceAlpha',.6)
axis equal
hold on
plot3(xyz(:,1),xyz(:,2),xyz(:,3), 'k*', 'MarkerSize', 12, 'LineWidth',2)
xlabel('x'); ylabel('y'); zlabel('z')
view([-187, 23])

Products

Community Treasure Hunt

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

Start Hunting!