Original Post
Hi all,
I’m doing some university work based around aircraft in the air traffic system and I’m looking to use a lot of geometrical math typically found in game development. Right now, I'm trying to find out if an aircraft trajectory path intersects a circle in 2D. My path is defined by 7th degree x and y polynomials parameterised by time. The distance between the circle (Coordinates [EQN]W_x[/EQN] , [EQN]W_y[/EQN] and radius r)and the x,y trajectory path is then
[EQN]d(t)=\sqrt{(x(t)-W_x )^2+(y(t)-W_y )^2 }-r[/EQN]
By setting d(t) to zero and finding the roots of the equation I can find either the intersection time or the closest point of approach time between the path and the circle. However, to find the roots of the equation, which factors out to be a 14th degree polynomial, I have to use a numerical root finder. Are there analytical or simply better ways of finding the time of intersection between a trajectory path and a circle?? Also, what if I wanted to find the time of intersection between a trajectory and a rotated rectangle/ square? Can I do it with simple math, such as the root finding approach I used above, or do I need an algorithms with if statements etc? I've seen people here recommend the GJK algorithm, so I'll try that next. Any recommendatins, pointers or suggestions would be warmly received.
I’m doing some university work based around aircraft in the air traffic system and I’m looking to use a lot of geometrical math typically found in game development. Right now, I'm trying to find out if an aircraft trajectory path intersects a circle in 2D. My path is defined by 7th degree x and y polynomials parameterised by time. The distance between the circle (Coordinates [EQN]W_x[/EQN] , [EQN]W_y[/EQN] and radius r)and the x,y trajectory path is then
[EQN]d(t)=\sqrt{(x(t)-W_x )^2+(y(t)-W_y )^2 }-r[/EQN]
By setting d(t) to zero and finding the roots of the equation I can find either the intersection time or the closest point of approach time between the path and the circle. However, to find the roots of the equation, which factors out to be a 14th degree polynomial, I have to use a numerical root finder. Are there analytical or simply better ways of finding the time of intersection between a trajectory path and a circle?? Also, what if I wanted to find the time of intersection between a trajectory and a rotated rectangle/ square? Can I do it with simple math, such as the root finding approach I used above, or do I need an algorithms with if statements etc? I've seen people here recommend the GJK algorithm, so I'll try that next. Any recommendatins, pointers or suggestions would be warmly received.