Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your question is unclear on a couple of points, so I have to make some assumptions:</p> <ol> <li>During each time interval, translation speed and rotational velocity are constant. <li>You know the values of these variables in every time interval (and you know rotational velocity in usable units, like radians per second, not just "very left"). <li>You know initial heading. <li> You can maintain enough precision that roundoff error is not a problem. </ol> <p>Given that, <b>there is an exact solution</b>. First the easy part:</p> <pre><code>delta_angle = omega * delta_t </code></pre> <p>Where omega is the angular velocity. The distance traveled (maybe along a curve) is</p> <pre><code>dist = speed * delta_t </code></pre> <p>and the radius of the curve is</p> <pre><code>radius = dist / delta_angle </code></pre> <p>(This gets huge when angular velocity is near zero-- we'll deal with that in a moment.) <b>If angle (at the beginning of the interval) is zero</b>, defined as pointing in the +x direction, then the translation in the interval is easy, and we'll call it deta_x_0 and delta_y_0:</p> <pre><code>delta_x_0 = radius * sin(delta_angle) delta_y_0 = radius * (1 - cos(delta_angle)) </code></pre> <p>Since we want to be able to deal with very small delta_angle and very large radius, we'll expand sin and cos, and use this only when angular velocity is close to zero:</p> <pre><code>dx0 = r * sin(da) = (dist/da) * [ da - da^3/3! + da^5/5! - ...] = dist * [ 1 - da^2/3! + da^4/5! - ...] dy0 = r * (1-cos(da)) = (dist/da) * [ da^2/2! - da^4/4! + da^6/6! - ...] = dist * [ da/2! - da^3/4! + da^5/6! - ...] </code></pre> <p><b>But angle generally isn't equal to zero, so we have to rotate these displacements</b>:</p> <pre><code>dx = cos(angle) * dx0 - sin(angle) * dy0 dy = sin(angle) * dx0 - cos(angle) * dy0 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload