# How to solve a linear system inside Manipulate and use the result for Plot?

I typed a code for showing a plane and a line, and solve a system, but I can´t show the intersection, because I don´t know.

Here is a minimal working example for understanding my problem ( the real problem is here http://bit.ly/1SNxWJH )

In this code I would like to show the solution of the system for the unknows (x,y): a x + b y == c AND d x + e y == f and plot it

at everytime, So if I move the slider of a,b,c,d,e,f I would like to view/show the point (x,y) that is the solution of hte system

Manipulate[
s = Solve[a x + b y == c && d x + e y == f];
ListPlot[{s[[1, 1, 2]], s[[1, 2, 2]]}],
Style[s, Bold],

{a, 1, 10},
{b, 2, 10},
{c, 3, 10},
{d, 2, 10},
{e, 5, 10},
{f, 8, 10}
]


I tried using Dynamic@ and DynamicModule, but I have not a good result.

• Do you want to solve the linear system for x and y? What do you wish to plot? Nov 20, 2015 at 23:10
• @bill-s .... I want to plot the solution Nov 20, 2015 at 23:12
• Mika, I'm afraid that I still don't understand. Could you explain exactly you consider to be "the solution" here? Have you seen the structure of the result returned by your Solve expression, and is that really what you wanted? Nov 20, 2015 at 23:22

Manipulate[
Module[{soln, pt},
soln = Solve[
a x + b y == c && d x + e y == f,
{x, y}][[1]];
Column[{
StringForm["Intersection of lines: ", soln],
pt = {x, y} /. soln;
ContourPlot[{a x + b y == c, d x + e y == f},
{x, -10, 10}, {y, -10, 10},
Axes -> True,
Epilog -> If[Length[pt] > 0,
{Red, AbsolutePointSize[4],
Tooltip[Point[pt], pt]}, {}],
ImageSize -> Medium]}]],
Row[{Control[{a, 1, 10, 1, Appearance -> "Labeled"}],
Control[{b, 2, 10, 1, Appearance -> "Labeled"}]}],
Row[{Control[{c, 3, 10, 1, Appearance -> "Labeled"}],
Control[{d, 2, 10, 1, Appearance -> "Labeled"}]}],
Row[{Control[{e, 5, 10, 1, Appearance -> "Labeled"}],
Control[{f, 8, 10, 1, Appearance -> "Labeled"}]}]]


• and How could I customize the TEXT in the Label, Supose that I want to view "SLOPE" instead a, or "RADIUS" instead b. I´m not used to use Control. I must learn. Thank you. Nov 21, 2015 at 6:12
• @MikaIke - as shown in the documentation -- just add a label, e.g., Control[{{a, 1, "SLOPE"}, 1, 10, 1, Appearance -> "Labeled"}] Nov 21, 2015 at 6:30
• thank you. I looked for that, but I can´t view in the Help: iestrada.eu/snapshots/snap04hghg7.jpg Nov 21, 2015 at 6:33
• @MikaIke - look at the next to last entry in the table: {{u, Subscript[u, init], Subscript[u, lbl]}, ...} include label Subscript[u, lbl] Nov 21, 2015 at 6:40
• You´re right, thank you very much! for helping and instructing me. Nov 21, 2015 at 6:44