Issue Details (XML | Word | Printable)

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

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

Utility methods for calculating the Euclidean distance between two points

Created: 30/Apr/09 10:52 PM   Updated: 07/Aug/09 09:14 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works GeometryUtil.java 2009-04-30 10:53 PM Benjamin McCann 0.9 kB
Java Source File Licensed for inclusion in ASF works GeometryUtilTest.java 2009-04-30 10:53 PM Benjamin McCann 0.3 kB

Resolution Date: 01/May/09 09:53 PM


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Benjamin McCann added a comment - 30/Apr/09 10:53 PM
I didn't see a method like this in Math Utils yet. It's pretty basic and helpful, so I think it would be beneficial.

Benjamin McCann made changes - 30/Apr/09 10:53 PM
Field Original Value New Value
Attachment GeometryUtilTest.java [ 12406970 ]
Attachment GeometryUtil.java [ 12406969 ]
Repository Revision Date User Message
ASF #770798 Fri May 01 19:29:44 UTC 2009 luc Added distance1, distance and distanceInf utility methods for double and int arrays in MathUtils
JIRA: MATH-265
Files Changed
MODIFY /commons/proper/math/trunk/src/java/org/apache/commons/math/util/MathUtils.java
MODIFY /commons/proper/math/trunk/src/site/xdoc/changes.xml
MODIFY /commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java

Luc Maisonobe added a comment - 01/May/09 09:53 PM
fixed in subversion repository as of r770798
The methods have been put in MathUtils instead of a dedicated GeometryUtil.
An error in the double version has been fixed (int sum instead of double sum).
In addition to the L2 (euclidean) distance, the L1 and Linf distances have also been added.
thanks for the report and for the patch

Luc Maisonobe made changes - 01/May/09 09:53 PM
Resolution Fixed [ 1 ]
Assignee Luc Maisonobe [ luc ]
Status Open [ 1 ] Resolved [ 5 ]
Benjamin McCann added a comment - 02/May/09 12:47 AM
Thanks Luc.
(FYI, MATH-266 made use of GeometryUtil, and will need just a minor tweak to MathUtils in order to compile.)

Luc Maisonobe added a comment - 07/Aug/09 09:14 AM
closing resolved issue for 2.0 release

Luc Maisonobe made changes - 07/Aug/09 09:14 AM
Status Resolved [ 5 ] Closed [ 6 ]