Issue Details (XML | Word | Printable)

Key: MATH-263
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Luc Maisonobe
Reporter: Gilles
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Math

Various distance methods in "Vector3D"

Created: 29/Apr/09 09:49 AM   Updated: 07/Aug/09 09:13 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 29/Apr/09 07:10 PM


 Description  « Hide
Hi.

As was discussed in the ML (cf. '[math] "equals" in "Vector3D"' thread), it would be useful to add the various distance methods: L1 norm, L2 norm, L-infinity norm.

One suggestion has been to use an enum:

enum Norm { L_0, L_1, L_2, L_infinity };
static double distance(Vector3D a, Vector3D b, Norm n) { ... }

Another, to define several methods:

a.distance1(b) { ... }
a.distance(b) { ... }
a.distanceInf(b) { ... }

At the cost of longer typing (but maybe there are other advantages) the above could also be static.

Best,
Gilles



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Luc Maisonobe made changes - 29/Apr/09 07:10 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Assignee Luc Maisonobe [ luc ]
Status Open [ 1 ] Resolved [ 5 ]
Luc Maisonobe made changes - 07/Aug/09 09:13 AM
Status Resolved [ 5 ] Closed [ 6 ]