acmerobotics / road-runner

Wheeled mobile robot motion planning library designed for FTC
MIT License
209 stars 75 forks source link

What n means in in line 189 of Curves.kt? #104

Closed EthanHu29 closed 1 month ago

EthanHu29 commented 1 month ago

In other functions, for example in line 64 of Curves.kt, where n means order of derivative. in function get(t: Double, n: Int).

If in the function from line 189 to line 206, n still means the order of derivates, for example, assume n=1, in Vector2dDual(DualNum x, DualNum y), we need to get x, dx/du, y, dy/du.. which means the function should return in line 195 to get the expected outcome.

But currently, the function will return in line 195, because if (n <= 1) return point.reparam(DualNum(tValues))

EthanHu29 commented 1 month ago

I got it, n should be the size of the DoubleArray, not the order of the derivation.