• ### What is your GameDev Story?

This topic is 1275 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have 3 quadratic equations in the following form:

(x-y)*(x-y) + (x-y)*(x-y) + (x-y)*(x-y)=2

(y-z)*(y-z) +(y-z)*(y-z) + (y-z)*(y-z)=2

(x-z)*(x-z) + (x-z)*(x-z) + (x-z)*(x-z)=2

(where before every x and y and z written is arbitrary multiplier, such as 2.1*x)

I wonder wheather the fact that in each of the equations are mentioned only two of the unknowns, not all three, is a problem for finding a solution.

What would be some numericaly stable method of finding the solution?

##### Share on other sites

You are gonna want to expand the (x-y)^2's in all the equations, you should have no problem solving the equations and then substituting them if you do that.

Edited by mousetail

##### Share on other sites

Are you sure those equations are correct? All 3 terms in each line are the same, so the first line is actually equivalent to 3 * (x - y)^2 = 2.

Besides that, I think it might be easier to let

a = x - y

b = y - z

c = a + b

Then

3a^2 = 2

3b^2 = 2

3(a + b)^2 = 2

So it doesn't have any solutions, since a, b = +/- sqrt(2 / 3), but these don't solve the 3rd equation.

Edited by quasar3d

##### Share on other sites

Are you sure those equations are correct? All 3 terms in each line are the same, so the first line is actually equivalent to 3 * (x - y)^2 = 2.

He left out the co-efficients (for some reason). As he said in his post:

(where before every x and y and z written is arbitrary multiplier, such as 2.1*x)

##### Share on other sites

Thanks for substitution idea, though it is not doable particulary like that  since you didn't notice the multiplier note.

3a^2 = 2

3b^2 = 2

3(a + b)^2 = 2

So it doesn't have any solutions, since a, b = +/- sqrt(2 / 3), but these don't solve the 3rd equation.

In case of all multipliers being 1.0, or equal, to make construct that the equations describe make sense, the solution is only with zeros on the right side.

You are gonna want to expand the (x-y)^2's in all the equations, you should have no problem solving the equations and then substituting them if you do that.

The thing with this is, that I will recieve x,y,xy,x^2,y^2 and I have big doubts particulary about the xy uknown. But are those equations of x,y,z actualy solvable? With 2,2,2 right side, and with any possible R multipliers where values differ (the 9 multipliers would actualy describe any three 3d vectors where at least one is not parallel ).

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634146
• Total Posts
3015772
×