# Generating plane equation from LinearSolve

I will ask a simple question and might have an issue on the site that explains better about it, but not found.

I am formulating a code that defines me an equation that I can generate a plot.

m = {{1, 1, 1}, {1, 2, 3}, {1, 4, 9}};
b = {1, 2, 3};
abc=LinearSolve[m, b]
f=abc[]*x+ abc[]*y+ abc[]*z
sol=Solve[f==0,z]
Plot3D[sol,{x,0,15},{y,0,15}]


Or

Plot3D[z,{x,0,15},{y,0,15}]


I'm realizing that there is a mistake, but I do not know how to get an equation from LinearSolve output.

## 1 Answer

Solve is one of the functions that returns a list of rules and you need to use the /. Replace All command. Read: http://support.wolfram.com/kb/12505

m = {{1, 1, 1}, {1, 2, 3}, {1, 4, 9}};
b = {1, 2, 3};
abc = LinearSolve[m, b]
f = Dot[abc, {x, y, z}]
sol = Solve[f == 0, z]
Plot3D[z /. sol, {x, 0, 15}, {y, 0, 15}] And as J.M. mentioned f= Dot [abc, {x, y, z}]is the same as f = abc[]*x + abc[]*y + abc[]*z

• You can use Dot[] to form the equation, of course. – J. M.'s torpor Jul 14 '16 at 23:24
• Really! Sometimes the answer is so easy that does pass shame. – LCarvalho Jul 14 '16 at 23:27
• @LeandroMacieldeCarvalho No worries. Glad to help. – Young Jul 14 '16 at 23:32
• mathematica.stackexchange.com/questions/1457/… – Young Jul 15 '16 at 0:30
• "I do not know" - it was a hint for you to search the terms in a fabulous search engine, @Leandro. – J. M.'s torpor Jul 15 '16 at 0:43