Skip to content

Commit 443de57

Browse files
EwingKangDLu
authored andcommitted
Fix math in README (#37)
1 parent f9cab9c commit 443de57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dlux_global_planner/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ Below, we provide a "brief" mathematical derivation of the calculation.
115115
* `P(C) <= P(D)`
116116
* `P(A) <= P(C)`
117117
* If `P(C)` is infinite, that is, not initialized yet, the new potential calculation is straightforwardly ![P(X) = P(A) + h](https://latex.codecogs.com/gif.latex?P%28X%29%20%3D%20P%28A%29%20&plus;%20h).
118-
* Otherwise, we want to find a value of `P(X)` that satisfies the equation ![(P(X) - P(A))^2 + (P(X) - P(C))^2 = h](https://latex.codecogs.com/gif.latex?%5CBig%28P%28X%29%20-%20P%28A%29%5CBig%29%5E2%20&plus;%20%5CBig%28P%28X%29%20-%20P%28C%29%5CBig%29%5E2%20%3D%20h)
118+
* Otherwise, we want to find a value of `P(X)` that satisfies the equation ![(P(X) - P(A))^2 + (P(X) - P(C))^2 = h^2](https://latex.codecogs.com/gif.latex?%5CBig%28P%28X%29-P%28A%29%5CBig%29%5E2&plus;%5CBig%28P%28X%29-P%28C%29%5CBig%29%5E2%3Dh%5E2)
119119
* It's possible there are no real values that satisfy the equation if ![P(C) - P(A) >= h](https://latex.codecogs.com/gif.latex?P%28C%29%20-%20P%28A%29%20%5Cgeq%20h) in which case the straightforward update is used.
120120
* Otherwise, through clever manipulation of the quadratic formula, we can solve the equation with the following:
121121
* ![P(X) = 0.5 * (-beta + sqrt(beta^2 - 4 * gamma))](https://latex.codecogs.com/gif.latex?P%28X%29%20%3D%20%5Cfrac%7B-%5Cbeta%20&plus;%20%5Csqrt%7B%5Cbeta%5E2%20-%204%20%5Cgamma%7D%7D%7B2%7D)
122122
* ![beta = -(P(A) + P(C))](https://latex.codecogs.com/gif.latex?%5Cbeta%20%3D%20-%5CBig%28P%28A%29&plus;P%28C%29%5CBig%29)
123123
* ![gamma = 0.5 * (P(A)^2 + P(C)^2 - h^2)](https://latex.codecogs.com/gif.latex?%5Cgamma%20%3D%20%5Cfrac%7BP%28A%29%5E2%20&plus;%20P%28C%29%5E2%20-%20h%5E2%7D%7B2%7D)
124-
* That all looks complicated, and computationally inefficient due to the square root operation. Hence, we calculate a second-degree Taylor series approximation as
125-
* ![delta = beta / h](https://latex.codecogs.com/gif.latex?%5Cdelta%20%3D%20%5Cbeta%20/%20h)
124+
* That all looks complicated, and computationally inefficient due to the square root operation. Hence, we calculate a second-degree Taylor series approximation at ![x=P(C)+h/2](https://latex.codecogs.com/gif.latex?x=P(C)&plus;h/2) as
125+
* ![delta = (P(C) - P(A)) / h](https://latex.codecogs.com/gif.latex?%5Cdelta%3D%5Cfrac%7BP%28C%29-P%28A%29%7D%7Bh%7D)
126126
* ![P(X) = P(A) + h (c_2 \delta^2 + c_1\delta + c_0)](https://latex.codecogs.com/gif.latex?P%28X%29%20%5Capprox%20P%28A%29%20&plus;%20h%20%28c_2%20%5Cdelta%5E2%20&plus;%20c_1%5Cdelta%20&plus;%20c_0%29)
127127
* ![c_2 = -0.2301, c_1 = 0.5307, c_0 = 0.7040](https://latex.codecogs.com/gif.latex?c_2%20%3D%20-0.2301%2C%20c_1%20%3D%200.5307%2C%20c_0%20%3D%200.7040)
128128
* You can compare the two curves on [this plot](https://www.desmos.com/calculator/axz378nfqg)

0 commit comments

Comments
 (0)