[

https://issues.apache.org/jira/browse/GEOMETRY-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16763202#comment-16763202 ]

Matt Juntunen commented on GEOMETRY-41:

---------------------------------------

{quote}At least we'd have the "it's shorter" advantage.

{quote}

Ok. I'll make that update on this PR unless you have any objections.

{quote}Do you have a "real-world" example that requires {{DoublePrecisionContext}}?

{quote}

The idea of a "tolerance" was present in the original commons-math code and this is just an extension of it. I've used tolerances/epsilons set to different values when working with models that either have a very small range of vertex locations or very large. For example, the Utah teapot model I have worked with before has closely packed coordinate values all less than 1, whereas the models I use at work generally have large facets with coordinates up into the thousand range. I use larger tolerances for the larger models so that the calculations don't get bogged down with tiny facet subdivisions that don't make any difference in the overall geometry. I use smaller tolerances for the smaller models since the tiny facets are actually important in those cases.

I'm picturing {{DoublePrecisionContext}} as just a first stab at getting this right. I think the API will change as we explore this more. I don't really have a solid picture of what's required here from a mathematical perspective, just a practical perspective.

> Vector Precision Equals

> -----------------------

>

> Key: GEOMETRY-41

> URL:

https://issues.apache.org/jira/browse/GEOMETRY-41> Project: Apache Commons Geometry

> Issue Type: New Feature

> Reporter: Matt Juntunen

> Priority: Major

> Labels: pull-request-available

> Time Spent: 10m

> Remaining Estimate: 0h

>

> The {{Vector?D}} classes should expose {{equals}} method overloads that allow a precision object from GEOMETRY-11 to be passed in to determine equality. I propose adding the following two methods:

> 1. {{boolean equals(Vector?D vec, DoublePrecisionContext precision)}}

> 2. {{boolean isZero(DoublePrecisionContext precision)}}

>

> Pull request:

https://github.com/apache/commons-geometry/pull/24--

This message was sent by Atlassian JIRA

(v7.6.3#76005)