フィルターのクリア

Plane and sphere intersection

3 ビュー (過去 30 日間)
kalpana bandi
kalpana bandi 2021 年 5 月 18 日
コメント済み: kalpana bandi 2021 年 5 月 18 日
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 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 5 月 18 日
A couple of points require some changes, e.g.:
...
figure
fmesh(zplane)
hold on
[x, y, z] = sphere(50); % A bit more meshing
r = 6378.137*1000; % Scaling problem
x = x*r;
y = y*r;
z = z*r;
surf(x,y,z)
  1 件のコメント
kalpana bandi
kalpana bandi 2021 年 5 月 18 日
I am using 2015a version, I am getting error for fmesh

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

製品


リリース

R2011a

Community Treasure Hunt

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

Start Hunting!

Translated by