Isn't ` theta -= deltaTheta` going to introduce precision issues with each iteration?  This should instead be
```
theta = CesiumMath.PI_OVER_TWO;
for(i = 0; i < nupPts, theta > 0; ++i) {
theta -= i * deltaTheta;
...existing loop code...
}
```