Hi all

I have been trying to solve this problem for a while which I need for my project. Is there anyone with a strong passion for math and geometry and with time to spare who is willing to give me a hand?

I want to create, using the Pixel Processor, a gradient representing all the Normals to a semi ellipse (origin centered and with the 2 semi-axis parallel to the x and y axis respectively) defined by 2 attributes, Height (b) and Width (a).

Something like this.

orginated by something like this

The parameter Height is basically the minor semiaxis and Width the major semiaxis multiplied per 2.

Every point in the plane should get the value of the angle formed by the x axis and the one normal to the ellipse that passes for it.

It has been quite complicated for my non mathematical brain and so far I only managed to find partial solutions. I solved it using an FX map (the images below) rotating a very thin line around the ellipse circumference exactly in this way

https://commons.wikimedia.org/wiki/File:Normal_lines_to_the_ellipse.svg#/media/File:Evolute1.gif but the result is not as good as a gradient done with the pixel processor, as it creates a stepped effect even with thousands of iterations (ugh) and if I make the line thicker (tried that too) it becomes even more stepped.

I also solved it using a distance node on a regular angular gradient masked with the ellipse alpha. This works too, to a point, but is not perfect either. The result is stepped and wobbly (I think because of the jagged edge of the ellipse shaped mask).

Can anyone help me see the light? I'll be forever thankful

Ellipse equation:

y²/b² + x²/a² = 1

Point P on the Ellipse:

for every x where -a<x

_{P}<a

y

_{P}= b√1-(x²/a²)

Point K where the NORMAL in P to the ellipse meets the x AXIS:

x

_{K} = x

_{P} [1-(b/a²)]

y

_{K} = 0

Equation of the normal to the ellipse in P:

(a²x/x

_{P}) - (b²y/y

_{P}) = a² - b²

Angle between the Normal and the X Axis meeting in the point K:

atan2 (x

_{K}- x

_{P},y

_{K}- y

_{P},) (in Radians)

atan2 (x

_{K}- x

_{P},y

_{K}- y

_{P},)/2Pi (in Turns)