I have First derivative function implemented in C++. More details http://www.cplusplus.com/forum/general/103788/
Special Thank for Andy for helping me to implement it and thank for all of you guys for helping me in the previous link.
In programming, I'm dealing with a lot of variables.
x, y, z & x', y', z' & x'', y'', z'' These are only for one device. The problem is how can I deal with velocities and accelerations the way I did with positions? This is the code
I'm trying also to store x_Velocity in vector. Every time I deal with whether array or vector, the first two points of x position are affected because I'm calling the function for the velocity. Any suggestions?
Are you trying to use First_Derivative() to calculate the first few points? Rather than special casing them?
If you are special casing, and something still goes wrong, then please post the corresponding i/p values for the first 10 or so samples.
PS As you're working with C++, you could make the analysis code a lot simpler by using a 3D "vector" class (you could use std::vector (or std::array, if you're using C++11), but a fixed size, specialized class might be better here.)
You could easily enough implement you own. Or you could use one from a geometry library, like:
It worked but forgive me for this question. Why I should not consider the first points in my calculations since they are initialized as zero. About using vector or array, I thought at the first to use them but they confuse me because I need to use loop to retrieve the data. I'm thinking now to at least run the project then create a function that will be in charge of returning all the variables(x',y',z', x'', etc.) by only accepting stream data(x,y,z) as a parameter. I know it is not well-organized but at least I can track my code easily. Now I'm very close to run the project. Thanks again for your patience.