Skip to content

Conversation

mramato
Copy link
Contributor

@mramato mramato commented Jul 16, 2012

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.

EDIT: Forgot to mention that these changes are related to issues #71, #84, #86 (those issues will remain open until we address them for every Core type).

mramato added 5 commits July 16, 2012 13:13
1. Cartographic3 now has static versions of it's prototype methods.
2. Cartographic3 methods now work on object literals that expose longitude/latitude/height properties.
3. Cartographic3 now has proper error handling and full test coverage.
1. Remove all usage of creating Cartographic instances using degrees as internal representation, Cartographics are always represented as radians.
2. Add fromDegrees helper function to aid in creating Cartographics from degrees.
3. Reaname toCartesian(s) and toCartographic(s) methods to cartesianToCartographic/cartesianArrayToCartographicArray and cartographicToCartesian and cartographicArrayToCartesianArray respectively.
4. Fix comment in Quaternion.fromAxisAngle to specify the correct unit.
@shunter
Copy link
Contributor

shunter commented Jul 17, 2012

This all looks good to me. Given the major API changes, I think @pjcozzi should look at it too.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 17, 2012

825 additions
1,048 deletions

Awesome - less is more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps say "longitude, latitude, and height" since that is the order in the constructor.

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 17, 2012

@mramato Just that one comment and this is ready to go.

@mramato
Copy link
Contributor Author

mramato commented Jul 17, 2012

Thanks @pjcozzi, all done.

pjcozzi added a commit that referenced this pull request Jul 17, 2012
@pjcozzi pjcozzi merged commit a0894f5 into master Jul 17, 2012
pjcozzi added a commit that referenced this pull request Oct 22, 2015
Fixed crash when computing sensor horizon crossings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants