# Projected trajectory of a vehicle?

In the game I am developing, I have to calculate if my vehicle (1) which in the example is travelling north with a speed V, can reach its target (2). The example depict the problem from atop: There are actually two possible scenarios: V is constant (resulting in trajectory 4, an arc of a circle) or the vehicle has the capacity to accelerate/decelerate (trajectory 3, an arc of a spiral).

I would like to know if there is a straightforward way to verify if the vehicle is able to reach its target (as opposed to overshooting it). I'm particularly interested in trajectory #3, as I the only thing I could think of is integrating the position of the vehicle over time.

EDIT: of course the vehicle has always the capacity to steer, but the steer radius vary with its speed (think to a maximum lateral g-force).

EDIT2: also notice that (as most of the vehicles in real life) there is a minimum steering radius for the in-game ones too).

If you can vary your speed (thus your angle of steer) you will always find a solution, starting from the degenerate one where the entity is almost stopped rotating in a little circle until pointing the target.

If you can't vary your speed, you can think about unreachable areas or shadows that you can not reach even using your better steer, if the target is in those areas you cant reach it (unless "overshoot" you can even surpass them and put them out of the shadow area).

Your best steer let you to turn left/right on an arc of a circle, letting you to draw a complete circumference: As you can see what is inside one of the two circles cant be reached directly.

A body of mass m that is steering over a curve with radius of curvature r, experiences a radial apparent Centrifugal force caused by the inertial behavior of the body, equal to: where V is the speed of the body (the lenght of the velocity vector); being the acceleration of a body due a force being: our acceleration is: If we say that am is the maximum acceleration we obtain that: where rm is the mimimum radius using the maximum acceleration.

When you want to test if the veicle in P moving at speed V can reach the target in T you have to:

1) compute C1 and C2 as: 2) test the miminum distance of P from C1 and C2 as follow: If d is greater than rm this means that T is outside both the shadows and then is reachable by the vehicle simply adjusting the steer under the steer constraint. (to be more precise there is a path under constraints that let the function of distance between T and P be monotonically decreasing)

[UPDATE]

If it possible to change the velocity, is always possible to get an arc (i.e. a velocity/radial accelleration couple) that goes from P to T. This is possible because the radius becomes a truly degree of freedom.

This is a possible construction: The black line is the axis where the center of circles may lay: it is perpendicular to the current facing of the vehicle and passes through its center of rotation.

The green segment represents the line that is perpendicular to the one that connects the center of the vehicle with the target and passes through the middle of that distance.

The green line crosses the black one exactly at the center of the desired arc. The length of the orange segment tell us the radius of turning that can be achieved by regulating the velocity and turning at maximum steer or regulating both the velocity and the steer to stay under the constraint

• Thank you for having taken the time to write this detailed answer (+1). I need to "study" it a bit, but from a first reading it seems to me that your first statement "you will always find a solution..." is not necessarily true: the existence of a minimum steering radius implies that there always will be a "shadow area" whose limit will define a sort of "orbit" around the target... Or am I wrong? [This is indeed the real problem for me, as the calculation for V=k are straightforward...]
– mac
Sep 3, 2011 at 16:39
• @mac if the target is not in the same place of your vehicle, you can slow down so rmin generates a circle small enough to not contain the target. When you are in this condition you can set your velocity so the target lay exactly on your circumference! Sep 3, 2011 at 17:01
• @Fxill - Again, thank you for the update, if it was possible, I would give you a second +1 for the dedication! :) Still, I fail to understand from your explanation how you account for both the acceleration and the initial velocity: the entire problem relies in the fact that over time the velocity will change (arc of a spiral). I am under the impression there might be simply not enough space for the vehicle to slow enough / get a radius small enough to intercept the target... or am I wrong?
– mac
Sep 3, 2011 at 18:56
• @mac lets say am = 1 then rm = v^2; if d=|P-T| > 0 the you can choose v^2 < d/2; if d = 0 it means that P = T so you already reached your target... Sep 3, 2011 at 20:36
• hahaha no doubt that it works! :D Sep 6, 2011 at 5:49
{"ft_lang_label":"__label__en","ft_lang_prob":0.92625284,"math_prob":0.8586559,"size":2477,"snap":"2022-05-2022-21","text_gpt3_token_len":522,"char_repetition_ratio":0.12697129,"word_repetition_ratio":0.0,"special_character_ratio":0.20589423,"punctuation_ratio":0.061349694,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97603136,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18],"im_url_duplicate_count":[null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-24T22:45:17Z\",\"WARC-Record-ID\":\"<urn:uuid:b9c6f89a-4948-4ffc-beb6-4ba1a50eda55>\",\"Content-Length\":\"223067\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5b5460fe-cbe3-4df1-9f89-01866c8d6e4a>\",\"WARC-Concurrent-To\":\"<urn:uuid:3576b8e8-0f64-4485-b7ba-004321449a22>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://gamedev.stackexchange.com/questions/16810/projected-trajectory-of-a-vehicle\",\"WARC-Payload-Digest\":\"sha1:5A5ABPYXO3TYGZCQL54WPNZQYO5TEIEJ\",\"WARC-Block-Digest\":\"sha1:YJYRR6XDMIQTJVYNQQD2OYMCHLPAQLM2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662577259.70_warc_CC-MAIN-20220524203438-20220524233438-00720.warc.gz\"}"}