# Hint to solve equation having 3 unknowns

posted 8 years ago

Hi Friends!

I want to write program which will calculate value of X,Y,Z by solving following 3 polynomial equation:

(x-4)^2+ (y-0)^2 = (45 + 5Z))^2 ------Equ 1

(x-7)^2+ (y-2)^2 = (23 + 6Z))^2 ------Equ 2

(x-0)^2+ (y-3)^2 = (89 + 4Z))^2 ------Equ 3

Sorry for not submitting any tried code; since i have know clue what is the logic for this problem.

Please give me some suggestion to form some logic to write a java program for this!

Thanks in advance

I want to write program which will calculate value of X,Y,Z by solving following 3 polynomial equation:

(x-4)^2+ (y-0)^2 = (45 + 5Z))^2 ------Equ 1

(x-7)^2+ (y-2)^2 = (23 + 6Z))^2 ------Equ 2

(x-0)^2+ (y-3)^2 = (89 + 4Z))^2 ------Equ 3

Sorry for not submitting any tried code; since i have know clue what is the logic for this problem.

Please give me some suggestion to form some logic to write a java program for this!

Thanks in advance

Campbell Ritchie

Sheriff

Posts: 48382

56

Peter Chase

Ranch Hand

Posts: 1970

posted 8 years ago

Presumably, you are after an analytic, not numerical solution.

If I remember correctly, there is an analytic way of solving this type of puzzle. As I can't remember how, you probably want to read or Google "simultaneous quadratic equations" to find out. This forum is not the idea place to ask about hard maths.

If you want a numerical solution, the approach would be entirely different. For this type of simple equation, you could probably get away with Newton-Raphson.

So which is it?

One more thing: a quadratic with one variable has two solutions. I'm not sure how many solutions your three-variable problem has, but it could well be more than one. Some of the solutions could involve complex numbers, though. If there's more than one solution, and you need to find the the one(s) that are real numbers, that's an extra challenge.

[ February 25, 2008: Message edited by: Peter Chase ]

If I remember correctly, there is an analytic way of solving this type of puzzle. As I can't remember how, you probably want to read or Google "simultaneous quadratic equations" to find out. This forum is not the idea place to ask about hard maths.

If you want a numerical solution, the approach would be entirely different. For this type of simple equation, you could probably get away with Newton-Raphson.

So which is it?

One more thing: a quadratic with one variable has two solutions. I'm not sure how many solutions your three-variable problem has, but it could well be more than one. Some of the solutions could involve complex numbers, though. If there's more than one solution, and you need to find the the one(s) that are real numbers, that's an extra challenge.

[ February 25, 2008: Message edited by: Peter Chase ]

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.