
(sorry for the draw) I try to get the blue angle , i thought it was easy but...
the curve is a Bézier curve. the black dot shows the tangent of D I know position of A B C D.
I tried to get the angle by addition of angle a and angle b
the point F is found by multiplying AB per the time factor (between 0 and 1) the point E is found using the y coordinate of B and x coordinate of A
i get a with Al-Kashi method with the triangle FBD. i get b with Al-Kashi method too with the triangle EBA.
this is for rotation of an object who follow the curve and i always get weird result.
Is there any better way to do it and if not what I'm doing wrong ? thanks
It's not too hard: if you know the slope $m$ of the tangent (assuming it's not vertical), then the angle it makes with the positive x-axis is $\arctan(m)$; thus, the angle it makes with the positive y-axis should be the complement of that, or $\frac{\pi}{2}-\arctan(m)$
Better yet, since your Bézier curve is parametrically defined anyway, it would be a good idea to use the two-argument arctangent here to reckon the angle; I'll leave it to you to figure out the details.