Let be your ellipsoid. Define the function .

Now use the property that is orthogonal to the ellipsoid .

Thus, is orthogonal to the ellipsoid.

It remains to put a in front of it if you want it to be internal or external.

Put the right sign and you have your outward normal vector.