Ellipse Point Equation
x=x_centre+a*cos(t) y=y_centre+b*sin(t)
For each ellipse point, you can find t as atan2( (y-y_centre)/b , (x-x_centre)/a )
When you know t you can determine the tangent direction: dx/dt,dy/dt :
dx=-a*sin(t) dy=b*cos(t)
When you know the tangent direction, just rotate it 90 degrees and you have a normal one:
nx=b*cos(t) ny=a*sin(t)
And to avoid calculating t , we can combine it with the first two formulas:
nx=(x-x_centre)*b/a ny=(y-y_centre)*a/b
source share