Pagnatious
New member
- Joined
- Mar 3, 2010
- Messages
- 24
- Reaction score
- 0
- Points
- 0
With respect to finding the intersection point of two ellipses I am using the parameterized general ellipse equation to plot a point on one ellipse, then testing that points distances to the focal points of the second ellipse to see if it is a valid point on the second ellipse. As described here
It then suggests using the Newton-Raphson method to find the angles for which the point is on both ellipses. For that I need the derivative of the function. I haven't had to get that in a long time but here is my attempt and was wondering if anyone was willing to check my work.
[math]f(t) = \sqrt{u} + \sqrt{v} - 2a[/math]
[math]u = (h)^2 + (j)^2[/math]
[math](u)' = 2h*(h)' + 2j*(j)'[/math]
[math]v = (k)^2 + (l)^2[/math]
[math](v)' = 2k(k)' + 2l(l)'[/math]
[math]h = (X +AcosO*cos(t) - BsinO*sin(t)) - c[/math]
[math](h)' = 0 - AcosO* sin(t) - BsinO*cos(t) - 0[/math]
[math]j = (Y + AsinO*cos(t) + BcosO*sin(t)) - d[/math]
[math](j)' = 0 - AsinO*sin(t) + BcosO*cos(t) - 0[/math]
[math]k = (X +AcosO*cos(t) - BsinO*sin(t)) - c_2[/math]
[math](k)' = 0 - AcosO*sin(t) - BsinO*cos(t) - 0[/math]
[math]l = (Y + AsinO*cos(t) + BcosO*sin(t)) - d_2[/math]
[math](l)' = 0 - AsinO*sin(t) + BcosO*cos(t) - 0[/math]
[math]f(t) = \sqrt{u} + \sqrt{v} - 2a[/math]
[math]f'(t) = \frac{(u)'}{2\sqrt{u}} + \frac{(v)'}{2\sqrt{v}}[/math]
[math]f'(t) = \frac{2(h)(h)' + 2(j)(j)'}{2\sqrt{(h)^2 + (j)^2}} + \frac{2(k)(k)' + 2(l)(l)'}{2\sqrt{(k)^2 + (l)^2}}[/math]
[math]f'(t) = \frac{(h)(h)' + (j)(j)'}{\sqrt{(h)^2 + (j)^2}} + \frac{(k)(k)' + (l)(l)'}{\sqrt{(k)^2 + (l)^2}}[/math]
You can probably ignore the last line below, the monsterous one, as its just the above line with the h,j,k and l subbed in, but here it is anyway. It's too large to do in LaTeX even in divided in two parts.
f'(t) = \frac{2((X +AcosO*cos(t) - BsinO*sin(t)) - c)*(0 - AcosO* sin(t) - BsinO*cos(t)) + 2((Y + AsinO*cos(t) + BcosO*sin(t)) - d)*(0 - AsinO*sin(t) + BcosO*cos(t))}{2\sqrt{((X +AcosO*cos(t) - BsinO*sin(t)) - c)^2 + ((Y + AsinO*cos(t) + BcosO*sin(t)) - d)^2}} + \frac{2((X +AcosO*cos(t) - BsinO*sin(t)) - c_2)*(0 - AcosO* sin(t) - BsinO*cos(t)) + 2((Y + AsinO*cos(t) + BcosO*sin(t)) - d_2)*(0 - AsinO*sin(t) + BcosO*cos(t))}{2\sqrt{((X +AcosO*cos(t) - BsinO*sin(t)) - c_2)^2 + ((Y + AsinO*cos(t) + BcosO*sin(t)) - d_2)^2}}
Also I'd welcome any suggestions as to a good test to see first if they intersect so I can only apply the above when there will be an angle for which they intersect. They are orbits around the same body so they will share a focus and should at most intersect twice.
Thanks
---------- Post added 07-22-10 at 01:24 AM ---------- Previous post was 07-21-10 at 07:05 PM ----------
Using the LaTeX made life so much easier. I was able to see the difference between that I did and what Wolfram-Alpha did, mainly cancel out a *2 above and below the fractions, and then see that I had it the same for most of the way. It continues a bit further than I did though...
It also then put it into an alternate form
[math]f'(t) = \frac{h(t) h'(t) \sqrt{k(t)^2+l(t)^2} +l(t) \sqrt{h(t)^2+j(t)^2} l'(t)+j(t) j'(t) \sqrt{k(t)^2+l(t)^2)} } { \sqrt{(h(t)^2+j(t)^2} \sqrt{k(t)^2+l(t)^2)} }[/math]
and then an expanded form, which seems to remove a quarter of the equation. That doesn't seem right to me but I might be missing something that they do to get from
[math]f'(t) = \frac{h(t) h'(t)}{\sqrt{h(t)^2+j(t)^2}} + \frac{j(t) j'(t)}{\sqrt{h(t)^2+j(t)^2}} + \frac{l(t) l'(t)}{\sqrt{k(t)^2+l(t)^2}}[/math]
It then suggests using the Newton-Raphson method to find the angles for which the point is on both ellipses. For that I need the derivative of the function. I haven't had to get that in a long time but here is my attempt and was wondering if anyone was willing to check my work.
[math]f(t) = \sqrt{u} + \sqrt{v} - 2a[/math]
[math]u = (h)^2 + (j)^2[/math]
[math](u)' = 2h*(h)' + 2j*(j)'[/math]
[math]v = (k)^2 + (l)^2[/math]
[math](v)' = 2k(k)' + 2l(l)'[/math]
[math]h = (X +AcosO*cos(t) - BsinO*sin(t)) - c[/math]
[math](h)' = 0 - AcosO* sin(t) - BsinO*cos(t) - 0[/math]
[math]j = (Y + AsinO*cos(t) + BcosO*sin(t)) - d[/math]
[math](j)' = 0 - AsinO*sin(t) + BcosO*cos(t) - 0[/math]
[math]k = (X +AcosO*cos(t) - BsinO*sin(t)) - c_2[/math]
[math](k)' = 0 - AcosO*sin(t) - BsinO*cos(t) - 0[/math]
[math]l = (Y + AsinO*cos(t) + BcosO*sin(t)) - d_2[/math]
[math](l)' = 0 - AsinO*sin(t) + BcosO*cos(t) - 0[/math]
[math]f(t) = \sqrt{u} + \sqrt{v} - 2a[/math]
[math]f'(t) = \frac{(u)'}{2\sqrt{u}} + \frac{(v)'}{2\sqrt{v}}[/math]
[math]f'(t) = \frac{2(h)(h)' + 2(j)(j)'}{2\sqrt{(h)^2 + (j)^2}} + \frac{2(k)(k)' + 2(l)(l)'}{2\sqrt{(k)^2 + (l)^2}}[/math]
[math]f'(t) = \frac{(h)(h)' + (j)(j)'}{\sqrt{(h)^2 + (j)^2}} + \frac{(k)(k)' + (l)(l)'}{\sqrt{(k)^2 + (l)^2}}[/math]
You can probably ignore the last line below, the monsterous one, as its just the above line with the h,j,k and l subbed in, but here it is anyway. It's too large to do in LaTeX even in divided in two parts.
f'(t) = \frac{2((X +AcosO*cos(t) - BsinO*sin(t)) - c)*(0 - AcosO* sin(t) - BsinO*cos(t)) + 2((Y + AsinO*cos(t) + BcosO*sin(t)) - d)*(0 - AsinO*sin(t) + BcosO*cos(t))}{2\sqrt{((X +AcosO*cos(t) - BsinO*sin(t)) - c)^2 + ((Y + AsinO*cos(t) + BcosO*sin(t)) - d)^2}} + \frac{2((X +AcosO*cos(t) - BsinO*sin(t)) - c_2)*(0 - AcosO* sin(t) - BsinO*cos(t)) + 2((Y + AsinO*cos(t) + BcosO*sin(t)) - d_2)*(0 - AsinO*sin(t) + BcosO*cos(t))}{2\sqrt{((X +AcosO*cos(t) - BsinO*sin(t)) - c_2)^2 + ((Y + AsinO*cos(t) + BcosO*sin(t)) - d_2)^2}}
Also I'd welcome any suggestions as to a good test to see first if they intersect so I can only apply the above when there will be an angle for which they intersect. They are orbits around the same body so they will share a focus and should at most intersect twice.
Thanks
---------- Post added 07-22-10 at 01:24 AM ---------- Previous post was 07-21-10 at 07:05 PM ----------
Using the LaTeX made life so much easier. I was able to see the difference between that I did and what Wolfram-Alpha did, mainly cancel out a *2 above and below the fractions, and then see that I had it the same for most of the way. It continues a bit further than I did though...
It also then put it into an alternate form
[math]f'(t) = \frac{h(t) h'(t) \sqrt{k(t)^2+l(t)^2} +l(t) \sqrt{h(t)^2+j(t)^2} l'(t)+j(t) j'(t) \sqrt{k(t)^2+l(t)^2)} } { \sqrt{(h(t)^2+j(t)^2} \sqrt{k(t)^2+l(t)^2)} }[/math]
and then an expanded form, which seems to remove a quarter of the equation. That doesn't seem right to me but I might be missing something that they do to get from
[math]f'(t) = \frac{h(t) h'(t)}{\sqrt{h(t)^2+j(t)^2}} + \frac{j(t) j'(t)}{\sqrt{h(t)^2+j(t)^2}} + \frac{l(t) l'(t)}{\sqrt{k(t)^2+l(t)^2}}[/math]
Last edited: