commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond DeCampo (JIRA)" <>
Subject [jira] [Commented] (MATH-1284) Vector is-not-a Point
Date Sat, 22 Apr 2017 22:46:04 GMT


Raymond DeCampo commented on MATH-1284:

I agree with the issue as reported; from a mathematical POV a vector is not a point.

>From a CS POV I am having trouble seeing the value that having the interface {{Vector}}
extending the interface {{Point}} brings.  In fact, by having {{Vector}} extend {{Point}},
one ends up with a method in your {{Vector}} implementation where one is ostensibly calculating
the "distance from a vector to a point".  This isn't really satisfying to me from a mathematical
or CS perspective.  The implementations of the {{Point}} {{distance()}} method in {{Vector}}
implementations all immediately cast the {{Point}} to a {{Vector}} implementation.

I will prepare a branch with a proposal for resolving this issue.

> Vector is-not-a Point
> ---------------------
>                 Key: MATH-1284
>                 URL:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.5
>            Reporter: Roman Werpachowski
>            Priority: Minor
>             Fix For: 4.0
> The class hierarchy for geometry claims that Vector is-a Point:
> This is mathematically incorrect, see e.g.
> Just because they share the same numerical representation, Point and Vector shouldn't
be crammed into a common class hierarchy.

This message was sent by Atlassian JIRA

View raw message