GithubHelp home page GithubHelp logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
It would be nice if you provide sample list, which reproduces the issue (you 
can attach it as a code file). "slightly less than 2E9" is a bit vague. Also 
you don't tell anything about the number of points.

Original comment by [email protected] on 2 Oct 2014 at 7:06

from aforge.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 30, 2024
1) Provide list with 4 or more x,y list points where all values are 2E9 - 1. 

2) Try: 2,000,000,000. - 1. 
Given that, we've found issues with values much more reduced... 
We're not presently dedicated to this issue-- just trying to help you. 
We've found success & failures with values @ (.5 * Int32.MaxValue). 
We're in the field running real field data and not purposed @ debugging your 
code. 

3) The number of points is ~believed not critical, but obviously you need to 
get into the process... ie, >3. 
-------

Somewhat irritated by the tongue lash, 
spending a few hours after our immediate above, 
we believe we've found the problem: 

1) 
Within AForge's 2.2.5.0 AForge.Math.DLL @ method "public List<IntPoint> 
FindHull(List<IntPoint> points)", the following source line appears to be the 
issue: 
"if ((newPoint.X - prevPoint.X) * (lastPoint.Y - newPoint.Y) - (lastPoint.X - 
newPoint.X) * (newPoint.Y - prevPoint.Y) < 0)". 

2)This line, when loaded as previously described (ie, large Int32 magnitudes), 
May throw exception: 
 "...'System.ArgumentOutOfRangeException' occurred in MSCORLIB.DLL". 

3) Further investigation shows possibility of ~ (8 * Int32.MaxValue^2). 

4) Solution, we ~think:  Change the subject line so as to process LONG values; 
ex:

//-------------------------------------------------
                // check if current point is on the left side from two last points

                //test:
                long sub1 = newPoint.X - prevPoint.X;
                long sub2 = lastPoint.Y - newPoint.Y;
                long sub3 = lastPoint.X - newPoint.X;
                long sub4 = newPoint.Y - prevPoint.Y;
                long mult1 = sub1 * sub2;
                long mult2 = sub3 * sub4;
                long diff = mult1 - mult2;
                if (diff < 0)
                    //if ((newPoint.X - prevPoint.X) * (lastPoint.Y - newPoint.Y) - (lastPoint.X - newPoint.X) * (newPoint.Y - prevPoint.Y) < 0)
                    {
                        // add the point to the hull
                        convexHullTemp.Add(newPoint);
                        // and remove it from the list of points to process
                        pointsToProcess.RemoveAt(0);

                        prevPoint = lastPoint;
                        lastPoint = newPoint;
                    }
                    else
                    {
                        // remove the last point from the hull
                        convexHullTemp.RemoveAt(convexHullTemp.Count - 1);

                        lastPoint = prevPoint;
                        prevPoint = convexHullTemp[convexHullTemp.Count - 2];
                    }
//-------------------------------------------------

That's our 2cents, Vaguely. 
:-)

If you desire converse, please eme directly at "[email protected]" .
We're working in the gulf & google connect not regularly available. 
Bests, RJF. 





Original comment by [email protected] on 2 Oct 2014 at 9:18

from aforge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.