Intersection of plane and line.

7 vues (au cours des 30 derniers jours)
Stephanie Ciobanu
Stephanie Ciobanu le 9 Nov 2017
Commenté : Star Strider le 9 Nov 2017
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)?

Réponse acceptée

Star Strider
Star Strider le 9 Nov 2017
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 commentaires
Stephanie Ciobanu
Stephanie Ciobanu le 9 Nov 2017
it won't print anything
Star Strider
Star Strider le 9 Nov 2017
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by