[Date Index]
[Thread Index]
[Author Index]
Re: Form of a linear equation
*To*: mathgroup at smc.vnet.net
*Subject*: [mg53747] Re: [mg53734] Form of a linear equation
*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>
*Date*: Wed, 26 Jan 2005 04:36:26 -0500 (EST)
*References*: <200501251003.FAA14449@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
On 25 Jan 2005, at 10:03, DJ Craig wrote:
> I'm trying to convert this linear equation:
>
> -(4+4x+y) / 17^(1/2) = (2+x+y) / 2^(1/2)
>
> into the form:
>
> (a_)*x + (b_)*y + (c_) = 0
>
> This sounds simple enough, but I can't figure out how to make
> Mathematica do it. My TI-89 does it automatically, but I need to be
> able to do this like a batch process for a bunch of linear equations.
> Heres the solution the TI-89 gives me:
>
> \!\(\*
> StyleBox[\(\((\(\(-4\)\ \@17\)\/17 - \@2\/2)\)\ x + \((\(-\@17\)\/17
> - \
> \@2\/2)\)\ y - \(3\ \@17\)\/17 - \@2 = 0\),
> FontWeight->"Bold"]\)
>
> Just copy and paste that mess into Mathematica and it will change into
> the equation at the top, but in the form that I want it.
>
> I haven't been using Mathematica for long. I'm used to my TI-89; I've
> been using it for years.
One way is to use Collect:
eq=-(4+4x+y) / 17^(1/2) == (2+x+y) / 2^(1/2);
Collect[eq /. Equal -> Subtract, {x, y}] == 0
(-(1/Sqrt[2]) - 4/Sqrt[17])*x +
(-(1/Sqrt[2]) - 1/Sqrt[17])*y - 4/Sqrt[17] -
Sqrt[2] == 0
If you have several equations you can use Map:
(Collect[#1 /. Equal -> Subtract, {x, y}] == 0 & ) /@
{2*x + 3*y == x - y, 5*x - y == x + 2*y}
{x + 4*y == 0, 4*x - 3*y == 0}
Andrzej Kozlowski
Chiba, Japan
http://www.akikoz.net/~andrzej/
http://www.mimuw.edu.pl/~akoz/
Prev by Date:
**Re: Form of a linear equation**
Next by Date:
**Re: Form of a linear equation**
Previous by thread:
**Re: Form of a linear equation**
Next by thread:
**Re: Form of a linear equation**
| |