Intersection of plane and line.
2 views (last 30 days)
Show older comments
Stephanie Ciobanu
on 9 Nov 2017
Commented: Star Strider
on 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)?
0 Comments
Accepted Answer
Star Strider
on 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 Comments
Star Strider
on 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.
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!