       Re: new user help

• To: mathgroup at smc.vnet.net
• Subject: [mg13368] Re: [mg13296] new user help
• From: BobHanlon at aol.com
• Date: Mon, 20 Jul 1998 02:50:21 -0400
• Sender: owner-wri-mathgroup at wolfram.com

John,

eqn = -4*a*x + 6*a*y - 4*a == a*x^2 + a*y^2;

Since the equation is not of the form lhs == 0 and the coefficients of
x^2 and y^2 are not unity, it will be manipulated into the preferred
form first.

eqn[]

-4*a - 4*a*x + 6*a*y

eqn[]

a*x^2 + a*y^2

temp = eqn[]-eqn[];

temp == 0

-4*a - 4*a*x - a*x^2 + 6*a*y - a*y^2 == 0

Coefficient[temp, x^2]

-a

temp = (temp/% // Simplify);

temp == 0

4 + 4*x + x^2 - 6*y + y^2 == 0

h = -Coefficient[temp, x]/2

-2

k = -Coefficient[temp, y]/2

3

stdEqn = (x - h)^2 + (y - k)^2 == r^2 // ExpandAll

13 + 4*x + x^2 - 6*y + y^2 == r^2

temp == 0

4 + 4*x + x^2 - 6*y + y^2 == 0

Comparing term-by-term, then r^2 = 9; or

Solve[{temp == 0, stdEqn}, r, {x, y}]

{{r -> -3}, {r -> 3}}

(x - h)^2 + (y - k)^2 == r^2 /. %[]

(2 + x)^2 + (-3 + y)^2 == 9

% // ExpandAll // Simplify

4 + 4*x + x^2 - 6*y + y^2 == 0

Combining all of these steps into a function:

stdEllipse[eqn_, x_Symbol:x, y_Symbol:y] :=
Module[{stdEqn, h, k, r, temp},
temp = eqn[] - eqn[];
temp = temp/Coefficient[temp, x^2];
h = -Coefficient[temp, x]/2;
k = -Coefficient[temp, y]/2;
stdEqn = (x - h)^2 + (y - k)^2 == r^2;
stdEqn /. Solve[{temp == 0, stdEqn}, r, {x, y}][]];

stdEllipse[a x^2+a y^2==-4a x+6a y-4a]

(2 + x)^2 + (-3 + y)^2 == 9

stdEllipse[z^2+t^2+10z-8t+16==0, z, t]

(-4 + t)^2 + (5 + z)^2 == 25

stdEllipse[x^2+y^2-x-y+2==0]

(-(1/2) + x)^2 + (-(1/2) + y)^2 == -(3/2)

Clear[a, b, c];
stdEllipse[x^2 + y^2 + a*x + b*y + c == 0]

(a/2 + x)^2 + (b/2 + y)^2 == 1/4*(a^2 + b^2 - 4*c)

Bob Hanlon

In a message dated 7/17/98 10:43:09 AM, john at dlugosz.com wrote:

>I'm lost.  I just don't know how to get started...
>
>The excersize I've chosen for myself is to start with
>
>	x^2+y^2+4x-6y+4==0
>
>and manipulate it into the form (x-h)^2+(y-k)^2==r^2
>
>So... how do I "manipulate" the equasion?  The functions like Expand,
>Factor, etc. don't help much.  I my calculator (an HP48) I can point to
>specific subexpressions and apply operations to them, like factor,
>distribute, changing forms, etc.
>
>How do I collect the x's together in parens, the y's in parens, and
>complete the squares?  Doing it on paper defeats the point!  I want to
>learn how to "do math" using this tool.  That's more than just asking
>"OK, what's X?".  It means manipulating things and arranging them,
>getting to know how the symbols all fit together.

• Prev by Date: Re: Up N' Down values.
• Next by Date: Re: Tree plotting package?
• Previous by thread: new user help
• Next by thread: Re: new user help