I use the term "finish" loosely since I'm sure we'll need further functionality once we support support multiple CBs. 1. Change SunPosition to a class instead of a static object. 2. Rename `compute` to `update`; `update` does not return any data but rather sets properties on the `SunPosition` instance. 3. Flesh out documentation. 4. Optimize performance and reduce memory pressure. We no longer create throw-away instances. 5. Update CHANGES If for some reason we're not happy about changing this to a class, we can change it back to a function, but instead of returning an object literal, I would instead just return the Sun's position and people can compute the other values from that; this way we don't have to worry about creating a new object literal every time we compute. We only use position in the code right now anyway.
I missed this the first time around, `BoundingSphere.fromPoints` was creating dozens, if not hundreds, of Cartesian3 isntances each frame; depending on the type of data being used. This was eating up 20% of the CPU when running simple.czml. I've re-written the function to re-use all scrach variables and everything is much better now.
There was some collateral cleanup as well, but nothing that affects API or doc.
…nToCartographic has been returning the incorrect latitude all of this time. 1. cartesianToCartographic produced incorrect results, this is now fixed. 2. Fixed unit tests which broke after fixing cartesianToCartographic. 3. Full error checking. 4. Static versions of all prototype functions. 5. Functions now provide an optional result parameter for object re-use. 6. 100% unit test code coverage 7. Complete documentation. 8. Updated CHANGES. This change touched a lot of files, but all of the heavy lifting is in Ellipsoid and EllipsoidSpec. There's a tone of room for improvement now for code using Ellipsoid to be optmized, but I'll do that with a different pull. I think I quashed any new issues that cropped up due to the cartesianToCartographic fixed, but if anyone sees anything strange, let me know.