- #1
Seebs
- 1
- 0
This is a small part of a larger program I'm working on. This actually looked like a fun problem -- but I'm hitting a wall now.
Imagine a person riding a bicycle. You know their starting position (X1, Y1), and their initial heading.
Their destination is elsewhere at point (X2, Y2). They MUST ride a total distance of S along an elliptical path to reach their destination.
Assuming S is a sufficiently large enough value to actually travel to the destination, find the parametric representation of the path traveled.
What I've got so far:
The parametric representation of a general ellipse is as follows:
X(t) = Xc + a cos(t) cos([tex]\phi[/tex]) - b sin(t) sin([tex]\phi[/tex])
Y(t) = Yc + a cos(t) sin([tex]\phi[/tex]) + b sin(t) cos([tex]\phi[/tex])
where Xc, and Yc are the center of the ellipse, a and b are the major and minor semi-axes respectively, and [tex]\phi[/tex] is the angle between the X-axis and the major axis ( http://en.wikipedia.org/wiki/Ellipse#General_parametric_form" )
I would need to solve for Xc, Yc, a, b, [tex]\phi[/tex], t1, and t2.
7 unknowns, so I'd need 7 equations.
I get 4 equations using the start and end positions.
Since I know the heading at the start point, if I take the derivative of the general parametric equations I can use the slope of the starting point to get 2 more equations.
And finally, I can use my travel distance, S, with the general parametric arc length equation. http://tutorial.math.lamar.edu/Classes/CalcII/ParaArcLength.aspx"
If I clean it up, I get this equation for the arc length between t1 and t2 on an ellipse (excuse the formatting)
S = [tex]\int[/tex][tex]\stackrel{t2}{t1}[/tex]( a^2 sin(t)^2 + b^2 cos(t)^2 ) dt
So here's my wall.
I am implementing this into a computer program, and would need to find "a good solution" quickly. That elliptical arc length equation is throwing me a monkey wrench. Without it, I believe I could find the Jacobian, use Newton's method, and get my 7 unknowns in a handful of iterations.
I guess my question is, am I on the right track here? What is the best way to proceed? Is there a "why didn't you just" solution I'm not seeing?
(In my gut, something doesn't feel right -- like my two "heading" equations are not really independent of each other. I also think I can visualize at least two solutions to this problem given the set-up. If this is the case, that there isn't ONE solution, I'd simply need A solution. Any thoughts?)
Imagine a person riding a bicycle. You know their starting position (X1, Y1), and their initial heading.
Their destination is elsewhere at point (X2, Y2). They MUST ride a total distance of S along an elliptical path to reach their destination.
Assuming S is a sufficiently large enough value to actually travel to the destination, find the parametric representation of the path traveled.
What I've got so far:
The parametric representation of a general ellipse is as follows:
X(t) = Xc + a cos(t) cos([tex]\phi[/tex]) - b sin(t) sin([tex]\phi[/tex])
Y(t) = Yc + a cos(t) sin([tex]\phi[/tex]) + b sin(t) cos([tex]\phi[/tex])
where Xc, and Yc are the center of the ellipse, a and b are the major and minor semi-axes respectively, and [tex]\phi[/tex] is the angle between the X-axis and the major axis ( http://en.wikipedia.org/wiki/Ellipse#General_parametric_form" )
I would need to solve for Xc, Yc, a, b, [tex]\phi[/tex], t1, and t2.
7 unknowns, so I'd need 7 equations.
I get 4 equations using the start and end positions.
Since I know the heading at the start point, if I take the derivative of the general parametric equations I can use the slope of the starting point to get 2 more equations.
And finally, I can use my travel distance, S, with the general parametric arc length equation. http://tutorial.math.lamar.edu/Classes/CalcII/ParaArcLength.aspx"
If I clean it up, I get this equation for the arc length between t1 and t2 on an ellipse (excuse the formatting)
S = [tex]\int[/tex][tex]\stackrel{t2}{t1}[/tex]( a^2 sin(t)^2 + b^2 cos(t)^2 ) dt
So here's my wall.
I am implementing this into a computer program, and would need to find "a good solution" quickly. That elliptical arc length equation is throwing me a monkey wrench. Without it, I believe I could find the Jacobian, use Newton's method, and get my 7 unknowns in a handful of iterations.
I guess my question is, am I on the right track here? What is the best way to proceed? Is there a "why didn't you just" solution I'm not seeing?
(In my gut, something doesn't feel right -- like my two "heading" equations are not really independent of each other. I also think I can visualize at least two solutions to this problem given the set-up. If this is the case, that there isn't ONE solution, I'd simply need A solution. Any thoughts?)
Last edited by a moderator: