I have this equation:
f(t) = <x(t),y(t)>
What I would first like to do is figure out the normal vector at some point, t1. How do I do this in MATLAB?
I would then like to figure out the angle between the normal vector and the x-axis in MATLAB. If I can bypass finding the normal vector and just figure out the angle straight from f(t), that might be better.
it would be nice if there were some vector manipulation functions or something that I could use instead of manually taking the derivative of x(t) and y(t) and then finding the magnitude and all that stuff. Any help would be great!
With
dxbeing the time derivative ofx, i.e.(x(t+1)-x(t-1))/(2dt)(you can also use forward differentiation instead of central differences, of course), anddythe corresponding time derivative ofy, you can find the angle between the normal and the x-axis easily from the vector [dx,dy], since its normal is just [-dy,dx].Assuming n-by-1 arrays
xandywith the coordinates, you do this as follows: