udacity / fcnd-issue-reports

You can use this repository to file issue reports with the Flying Car Nanodegree content.
1 stars 4 forks source link

In L16.27, derivates for atan2(y,x) is not calculated correctly. #311

Open xcarnd opened 6 years ago

xcarnd commented 6 years ago

derivative for ∂atan2(y,x)/∂x is actually -y/(x^2+y^2) instead of -x/(x^2+y^2). same for ∂atan2(y,x)/∂y.

Wolfram alpha result for reference (I've done that by hand too, same as result from wolfram alpha)

http://www.wolframalpha.com/input/?i=differentiate+atan2(y,x)

dyfc commented 6 years ago

I also think the second row in Jacobian should be like following: [-x[1] / (x[0]2 + x[1]2), x[0] / (x[0]2 + x[1]2)] Surprisingly either way estimation result is about the same.