# Generating plane equation from LinearSolve

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[[1]]*x+ abc[[2]]*y+ abc[[3]]*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.

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[[1]]*x + abc[[2]]*y + abc[[3]]*z

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