GithubHelp home page GithubHelp logo

Comments (3)

the-code-samurai-97 avatar the-code-samurai-97 commented on June 9, 2024

@andershol check this link
https://compiler-explorer.com/z/rzE1oab7j
you can check this python script , you can plot in your system and try it out
https://compiler-explorer.com/z/Gc3P1oex1
Figure_1
Figure_2

it is giving the correct points

from geometry.

andershol avatar andershol commented on June 9, 2024

check this link https://compiler-explorer.com/z/rzE1oab7j

I think you misunderstood, but perhaps I was imprecise. Except from making the output a bit more verbose (I tried to keep it short), your code seem identical to mine, and your result also seems to be identical. That is, there are 10 points in the output, but only 4 distinct points, so the quadrilateral is traversed twice.

you can check this python script , you can plot in your system and try it out https://compiler-explorer.com/z/Gc3P1oex1 it is giving the correct points

I was not saying that the points in the output is placed incorrectly. I was saying that the path goes around the rim twice. You don't see that, when you just draw the polygon as you don't see that every line segment is painted twice.

from geometry.

vissarion avatar vissarion commented on June 9, 2024

I can reproduce the issue with 1.84. This is a bug.

On my platform (linux, gcc9) the issue is "resolved" when using long double instead of double yielding the following output:
POLYGON((-0.91 0.48,-1.2 0.4,-1.4 1.9,-0.90478776881880620085 0.51756843862593651808,-0.90478776881879174887 0.51756843862590162786,-0.91 0.48))

Note that polygon a has 5 points (including closing duplicate), polygon b has 4 points, but output has 10 and I don't think the output should ever have more points than the sum of the input polygons. And going around twice seems to me to be invalid.

A side remark here, the output is indeed invalid but the statement about the number of vertices of the union is incorrect. Please consider the creation of new vertices in the union as the intersection of edges of the input polygons. Note, that the output computed with long double has also 5 vertices.

from geometry.

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.