File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Hint to solve equation having 3 unknowns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hint to solve equation having 3 unknowns" Watch "Hint to solve equation having 3 unknowns" New topic

Hint to solve equation having 3 unknowns

rushikesh kale
Ranch Hand

Joined: Jan 25, 2005
Posts: 41

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
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46320
You will have to look in a mathematics book for "simultaneous quadratic equations."
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
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 ]

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
I agree. Here's the link:
subject: Hint to solve equation having 3 unknowns
It's not a secret anymore!