Show intersection of two spheres

조회 수: 5 (최근 30일)
ercan duzgun
ercan duzgun 2021년 1월 6일
편집: Adam Danz 2021년 1월 6일
How can I show the intersections of two spheres on MATLAB plot?
My code is this:
close all;clear all;clc;
pA1=[-2.9,-0.9,0]';
pA2=[-1.2,3.0,0]';
pB1=[1.3,-2.3,0]';
pB2=[-1.2,-3.7,0]';
pC1=[2.5,4.1,0]';
pC2=[3.2,1.0,0]';
patch([pA1(1),pA2(1),pC1(1),pC2(1),pB1(1),pB2(1)],[pA1(2),pA2(2),pC1(2),pC2(2),pB1(2),pB2(2)],0)
grid on; axis equal;hold on;
text(pA1(1),pA1(2),'A1');text(pA2(1),pA2(2),'A2')
text(pB1(1),pB1(2),'B1');text(pB2(1),pB2(2),'B2')
text(pC1(1),pC1(2),'C1');text(pC2(1),pC2(2),'C2')
L1=5.0;L2=4.5;L3=5.0;L4=5.5;L5=5.5;L6=5.7;
%kure ciziyor
[x y z] = sphere(128);x=L1*x;y=L1*y;z=L1*z;
h = surfl(x+pA1(1), y+pA1(2), z+pA1(3));
set(h, 'FaceAlpha', 0.1)
shading interp
[x y z] = sphere(128);x=L2*x;y=L2*y;z=L2*z;
h = surfl(x+pA2(1), y+pA2(2), z+pA2(3));
set(h, 'FaceAlpha', 0.5)
shading interp
patch([pA1(1),pA2(1),pC1(1),pC2(1),pB1(1),pB2(1)],[pA1(2),pA2(2),pC1(2),pC2(2),pB1(2),pB2(2)],0)
  댓글 수: 1
Adam Danz
Adam Danz 2021년 1월 6일
편집: Adam Danz 2021년 1월 6일
> How can I show the intersections of two spheres on MATLAB plot?
This has been addressed in the forum several times:

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by