Uploaded image for project: 'Commons Geometry'
  1. Commons Geometry
  2. GEOMETRY-2

Clean up Point/Vector API

Agile BoardAttach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • None
    • None
    • None

    Description

      The current Point/Vector API requires a lot of casting internally and will be difficult to extend since it makes numerous assumptions about the objects passed into methods via the interfaces. For example, o.a.c.geometry.euclidean.threed.Line#toSubspace(Vector<Euclidean3D>) immediately casts its argument to Point<Euclidean3D>, assuming that the concrete class implements both, although nothing in the interfaces requires this.

      I think this API needs to be refactored to remove these issues. Here are my main goals for this task:

      1. Remove the need to cast to concrete classes in implementations.
      2. Allow for easy extension in the future. One specific extension I want to allow is the addition of extra coordinate systems, for example, polar coordinates in Euclidean2D.
      3. Use obvious names for mathematical objects. We should have PointXD and VectorXD classes instead of CartesianXD.

       

      Pull request: https://github.com/apache/commons-geometry/pull/2 

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mattjuntunen Matt Juntunen
            mattjuntunen Matt Juntunen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment