AnalyticalGraphicsInc/cesium — pull request #109 by mramato (2012-07-16 19:52:45+00:00)
Title: Cartographic cleanup.

Unlike the recent Cartesian cleanup, Cartographic cleanup was a little more all over the place. The biggest aspect of this change is making sure we no longer construct Cartographic instances that store their internal values as degrees. Instead we always require Cartographic instances to be expressed in radians. This will clean-up the API and make using Cartographics much less error-proned. Obviously users like degrees, so we make it easy to create Cartographics from degrees, we just don't store them that way. There's still plenty of cleanup to be done on other core types that use Cartographic, like Ellipsoid, but that will be done in another pull request. This once concentrates on just Cartographic itself. That being said, I did rename some Ellipsoid methods because they were very unclear.

1. `Cartographic3` has been renamed to `Cartographic`.
2. `Cartographic2` use been removed as it is redundant, us `Cartographic` with height 0.0 instead.
3. `Cartographic` now has static versions of all prototype methods and can now perform operations with object literals as long as they have `longitude`, `latitude`, and `height properties`.
4. Added `Cartographic.fromDegrees` to make it easier to create Cartographic instances from values in degrees. This simple converts the components to radians before calling the constructor.
5. Added proper error checking to `Cartographic` and brought test coverage up to 100%.
6. `Ellipsoid.toCartesian` was renamed to `Ellipsoid.cartographicToCartesian`
7. `Ellipsoid.toCartesians` was renamed to `Ellipsoid.cartographicArrayToCartesianArray`
8. `Ellipsoid.toCartographic2` was renamed to `Ellipsoid.cartesianToCartographic`
9. `Ellipsoid.toCartographic2s` was renamed to `Ellipsoid.cartesianArrayToCartographicArray`
10. `Ellipsoid.toCartographic3` was renamed to `Ellipsoid.cartesianToCartographic`
11. `Ellipsoid.toCartographic3s` was renamed to `Ellipsoid.cartesianArrayToCartographicArray`
12. `Ellipsoid.cartographicDegreesToCartesian', `Math.cartographic3ToRadians`, `Math.cartographic2ToRadians`, `Math.cartographic2ToDegrees`, and `Math.cartographic3ToDegrees` were removed. These functions are no longer needed because Cartographic instances are always represented in radians.
13. Replace custom spherical conversion code in `CustomSensorVolume` with calls to `Cartesian3.fromSpherical`.
14. Updated documentation and CHANGES to reflect everything.