my dog learned polymorphism*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hint to solve equation having 3 unknowns" Watch "Hint to solve equation having 3 unknowns" New topic
Author

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
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hint to solve equation having 3 unknowns
 
Similar Threads
Head First Java exercise problem
the world's smallest number?
how to compare the values in arrays
yield calculation
Apply function names as parameters in other functions