Intersection of plane and line.
9 ビュー (過去 30 日間)
古いコメントを表示
what is the code to find the intersection of the plane x + 2y + 3z = 4 and line (x, y, z) = (2,4,6) + t(1,1,1)?
0 件のコメント
採用された回答
Star Strider
2017 年 11 月 9 日
One approach:
syms x y z t
% x + 2y + 3z = 4 and line (x, y, z) = (2,4,6) + t(1,1,1)
xl = 2 + t;
yl = 4 + t;
zl = 6 + t;
Eqn = x + 2*y + 3*z == 4;
Eqn = subs(Eqn, {x y z},{xl yl zl});
t = solve(Eqn, t)
Then, substitute back into the ‘line’ equations for ‘xl’, ‘yl’, and ‘zl’.
2 件のコメント
Star Strider
2017 年 11 月 9 日
It gave me:
t =
-4
in R2017b. This would yield:
xl = -2
yl = 0
zl = +2
Be sure you don’t have a semicolon at the end of the solve call line. That will suppress the output to the Command Window.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!