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

Baljit Singh edited comment on GEOMETRY-71 at 1/7/20 11:18 PM:
---------------------------------------------------------------

I also tried simple addition using the + operation. Still no difference. See 
below:
{code:java}
barycenterVector = barycenterVector.add(size, area.getBarycenter().getVector());
{code}

I think there may a flaw in the the algorithm. The linear combination is 
essentially a weighted average of the barycenter normals. While this is fine 
for Cartesian geometry, it may not work on spherical geometry. Another way to 
look at weighted average is interpolation. We know that spherical interpolation 
(slerp) is different from linear interpolation. I don't have a mathematical 
proof, but intuitively, a linear average does not seem appropriate.


was (Author: balsingh):
I also tried simple addition using the + operation. Still no difference. See 
below:
{code:java}
barycenterVector = barycenterVector.add(size, area.getBarycenter().getVector());
{code}

I think there may a flaw in the the algorithm. The linear combination is 
essentially a weighted average of the barycenters. While this is fine for 
Cartesian geometry, it may not work on spherical geometry. Another way to look 
at weighted average is interpolation. We know that spherical interpolation 
(slerp) is different from linear interpolation. I don't have a mathematical 
proof, but intuitively, a linear average does not seem appropriate.

> Investigate Spherical Barycenter Accuracy
> -----------------------------------------
>
>                 Key: GEOMETRY-71
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-71
>             Project: Apache Commons Geometry
>          Issue Type: Bug
>            Reporter: Matt Juntunen
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The current code for computing spherical barycenters in 
> {{ConvexArea2S.getBarycenter()}} seems to suffer from floating point accuracy 
> issues. The {{ConvexArea2STest.checkBarycenterConsistency()}} method checks 
> the consistency of the barycenter computation of a region by splitting the 
> region into two sections, computing the area and barycenter of each section, 
> and then computing the combined barycenter of the sections by adding the 
> barycenter of each scaled by its corresponding area. It is expected that the 
> combined barycenter computed in this way should equal the barycenter computed 
> for the region as a whole. However, in practice, a large epsilon value is 
> needed in the comparison in order for the tests to pass. We need to 
> investigate why this is the case.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to