Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this meant to be proportional? #1

Open
proEndreeper opened this issue Mar 19, 2021 · 0 comments
Open

Is this meant to be proportional? #1

proEndreeper opened this issue Mar 19, 2021 · 0 comments

Comments

@proEndreeper
Copy link

return ((data.vals[0] + data.vals[1] + data.vals[2] + 3 * data.vals[data.mid - 1]) / 3);

To me it looks like this line of code is giving a result that is 2 * degrees/second in terms of unit.

((data.vals[0] + data.vals[1] + data.vals[2] + 3 * data.vals[data.mid - 1]) / 3);
(deg/sec + deg/sec + deg/sec + 3*deg/sec)/3
(6*deg/sec)/3
2*deg/sec

For simpson's rule wouldn't you want it to be

((data.vals[0] + 4*data.vals[1] + data.vals[2]) / 6);
(deg/sec + 4*deg/sec + deg/sec)/6
(6*deg/sec)/6
deg/sec

Or if you are trying to keep the same proportions

((data.vals[0] + data.vals[1] + data.vals[2] + 3 * data.vals[data.mid - 1]) / 6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant