필터 지우기
필터 지우기

intersection of plane and surface

조회 수: 5 (최근 30일)
kalpana bandi
kalpana bandi 2021년 6월 6일
답변: Star Strider 2021년 6월 6일
I have 3 points that forms a plane and a sphere with radius 6378.137 that is earth. I want the intersection of plane and sphere.
below is my code , it is not showing sphere and plane intersection
clc;
clear all;
pos1 = [1721.983459 6743.093409 -99.586968 ];
pos2 = [1631.384326 6813.006958 37.698529];
pos3 = [1776.584150 6686.909340 60.228160];
normal = cross(pos1-pos2, pos1-pos3)
syms x y z
p = [x y z];
planefun = dot(normal,p-pos1);
zplane = solve(planefun,z)
figure
ezmesh(zplane)
hold on
[x, y, z] = sphere;
r = 6378.137;
x = x*r;
y = y*r;
z = z*r;
surf(x,y,z)

답변 (1개)

Star Strider
Star Strider 2021년 6월 6일
Use fsurf (or fmesh) and then use the view function to rotate it for best results —
pos1 = [1721.983459 6743.093409 -99.586968];
pos2 = [1631.384326 6813.006958 37.698529];
pos3 = [1776.584150 6686.909340 60.228160];
normal = cross(pos1-pos2, pos1-pos3)
normal = 1×3
1.0e+04 * 1.8887 2.1975 0.1273
syms x y z
p = [x y z];
planefun = dot(normal,p-pos1);
zplane = solve(planefun,z)
zplane = 
figure
fsurf(zplane, 'r')
hold on
[x, y, z] = sphere;
r = 6378.137;
x = x*r;
y = y*r;
z = z*r;
surf(x,y,z)
view(60,30)
axis([-10000 10000 -10000 10000 -10000 10000])
.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by