What you are observing seems correct to me.
theta is 0, and phi is constant. This means that even as r increases
- y is zero (because theta is 0)
- x and z increase in proportion to each other
(You can see this is true in the xyz array, if you place a breakpoint and look at the values).
Therefore, the normal vector always points in the same direction -- and is constant because it is also normalized.
All seems well.
You can take the calculation
outside of the IJ loop, because its value doesn't depend on IJ. Just calculate it once for ever II loop.