quicksilver
New member
- Joined
- Jun 3, 2009
- Messages
- 2
I have these equations I was working on that although seemed simple, turned out to be deceptively hard.
r^2/s1^4 = (x-x1)^2 + (y-y1)^2
r^2/s2^4 = (x-x2)^2 + (y-y2)^2
r^2/s3^4 = (x-x3)^2 + (y-y3)^2
I need to solve for r, x, and y in terms of s1, s2, s3, x1, x2, x3, y1, y2, y3.
I tried solving by hand and was able to get it down to just one equation with one unknown but the equation was so complicated I could not figure out how to solve it. Perhaps my approach was not correct, could anyone give me some pointers?
Below is about how far I got, but the equation got to be far to complicated to work with.
We can easily remove the r from the first equation and simplify it to two equations.
s1^4*((x-x1)^2+(y-y1)^2) = s2^4*((x-x2)^2+(y-y2)^2)
s1^4*((x-x1)^2+(y-y1)^2) = s3^4*((x-x3)^2+(y-y3)^2)
We can take the first equation above and solve for Y:
s1^4*(x^2-2x*x1+x1^2+y^2-2y*y1+y1^2) = s2^4*(x^2-2x*x2+x2^2+y^2-2y*y2+y2^2)
s1^4*x^2-s1^4*2x*x1+s1^4*x1^2+s1^4*y^2-s1^4*2y*y1+s1^4*y1^2 = s2^4*x^2-s2^4*2x*x2+s2^4*x2^2+s2^4*y^2-s2^4*2y*y2+s2^4*y2^2
s1^4*y^2-s1^4*2y*y1-s2^4*y^2+s2^4*2y*y2 = s2^4*x^2-s2^4*2x*x2+s2^4*x2^2+s2^4*y2^2-s1^4*x^2+s1^4*2x*x1-s1^4*x1^2+s1^4*2y*y1-s1^4*y1^2
(s1^4-s2^4)*y^2+(2*s2^4*y1-2*s1^4*y2)*y = s2^4*(x^2-2x*x2+x2^2+y2^2) - s1^4(x^2-2x*x1+x1^2+y1^2)
(s1^4-s2^4)*y^2+(2*s2^4*y1-2*s1^4*y2)*y + (s1^4(x^2-2x*x1+x1^2+y1^2) - s2^4*(x^2-2x*x2+x2^2+y2^2)) = 0
y = (2*s1^4*y2-2*s2^4*y1 \pm{\sqrt{(2*s2^4*y1-2*s1^4*y2)^2-4*(s1^4-s2^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s2^4*(x^2-2x*x2+x2^2+y2^2)}})/(2s1^4-2s2^4)
We can solve for Y of the second equation the same way giving us:
y = (2*s1^4*y3-2*s3^4*y1 \pm{\sqrt{(2*s3^4*y1-2*s1^4*y3)^2-4*(s1^4-s3^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s3^4*(x^2-2x*x3+x3^2+y3^2)}})/(2s1^4-2s3^4)
By combining these two equations we get:
(2*s1^4*y2-2*s2^4*y1 \pm{\sqrt{(2*s2^4*y1-2*s1^4*y2)^2-4*(s1^4-s2^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s2^4*(x^2-2x*x2+x2^2+y2^2)}})/(2s1^4-2s2^4) = (2*s1^4*y3-2*s3^4*y1 \pm{\sqrt{(2*s3^4*y1-2*s1^4*y3)^2-4*(s1^4-s3^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s3^4*(x^2-2x*x3+x3^2+y3^2)}})/(2s1^4-2s3^4)
This is one equation with only one unknown (x). However solving this for x eludes me. There must be a simplier way.
r^2/s1^4 = (x-x1)^2 + (y-y1)^2
r^2/s2^4 = (x-x2)^2 + (y-y2)^2
r^2/s3^4 = (x-x3)^2 + (y-y3)^2
I need to solve for r, x, and y in terms of s1, s2, s3, x1, x2, x3, y1, y2, y3.
I tried solving by hand and was able to get it down to just one equation with one unknown but the equation was so complicated I could not figure out how to solve it. Perhaps my approach was not correct, could anyone give me some pointers?
Below is about how far I got, but the equation got to be far to complicated to work with.
We can easily remove the r from the first equation and simplify it to two equations.
s1^4*((x-x1)^2+(y-y1)^2) = s2^4*((x-x2)^2+(y-y2)^2)
s1^4*((x-x1)^2+(y-y1)^2) = s3^4*((x-x3)^2+(y-y3)^2)
We can take the first equation above and solve for Y:
s1^4*(x^2-2x*x1+x1^2+y^2-2y*y1+y1^2) = s2^4*(x^2-2x*x2+x2^2+y^2-2y*y2+y2^2)
s1^4*x^2-s1^4*2x*x1+s1^4*x1^2+s1^4*y^2-s1^4*2y*y1+s1^4*y1^2 = s2^4*x^2-s2^4*2x*x2+s2^4*x2^2+s2^4*y^2-s2^4*2y*y2+s2^4*y2^2
s1^4*y^2-s1^4*2y*y1-s2^4*y^2+s2^4*2y*y2 = s2^4*x^2-s2^4*2x*x2+s2^4*x2^2+s2^4*y2^2-s1^4*x^2+s1^4*2x*x1-s1^4*x1^2+s1^4*2y*y1-s1^4*y1^2
(s1^4-s2^4)*y^2+(2*s2^4*y1-2*s1^4*y2)*y = s2^4*(x^2-2x*x2+x2^2+y2^2) - s1^4(x^2-2x*x1+x1^2+y1^2)
(s1^4-s2^4)*y^2+(2*s2^4*y1-2*s1^4*y2)*y + (s1^4(x^2-2x*x1+x1^2+y1^2) - s2^4*(x^2-2x*x2+x2^2+y2^2)) = 0
y = (2*s1^4*y2-2*s2^4*y1 \pm{\sqrt{(2*s2^4*y1-2*s1^4*y2)^2-4*(s1^4-s2^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s2^4*(x^2-2x*x2+x2^2+y2^2)}})/(2s1^4-2s2^4)
We can solve for Y of the second equation the same way giving us:
y = (2*s1^4*y3-2*s3^4*y1 \pm{\sqrt{(2*s3^4*y1-2*s1^4*y3)^2-4*(s1^4-s3^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s3^4*(x^2-2x*x3+x3^2+y3^2)}})/(2s1^4-2s3^4)
By combining these two equations we get:
(2*s1^4*y2-2*s2^4*y1 \pm{\sqrt{(2*s2^4*y1-2*s1^4*y2)^2-4*(s1^4-s2^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s2^4*(x^2-2x*x2+x2^2+y2^2)}})/(2s1^4-2s2^4) = (2*s1^4*y3-2*s3^4*y1 \pm{\sqrt{(2*s3^4*y1-2*s1^4*y3)^2-4*(s1^4-s3^4)*s1^4(x^2-2x*x1+x1^2+y1^2) - s3^4*(x^2-2x*x3+x3^2+y3^2)}})/(2s1^4-2s3^4)
This is one equation with only one unknown (x). However solving this for x eludes me. There must be a simplier way.