Announcement

Collapse
No announcement yet.

So you're think you're good at math?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by loinburger View Post
    If I were given that problem spec I'd just pretend that the world was flat - the user's polygon is imprecise so we can fudge on expanding it
    I agree with this. Given that it's impossible to actually do distance-preserving conformal scalings, pretty much anything which gives a reasonable answer would be acceptable.
    12-17-10 Mohamed Bouazizi NEVER FORGET
    Stadtluft Macht Frei
    Killing it is the new killing it
    Ultima Ratio Regum

    Comment


    • #47
      Should I click on any of Ben's posts in this thread, or are his spherical geometry skills as poor as I would assume?
      12-17-10 Mohamed Bouazizi NEVER FORGET
      Stadtluft Macht Frei
      Killing it is the new killing it
      Ultima Ratio Regum

      Comment


      • #48


        Originally posted by Ben Kenobi
        Do you want to expand by all three directions?

        Asher, what Polars do for you is rather than getting into a messy coordinate as cartesians, they let you find a number that you are very interested in, the 'radii' of the object from the com.

        Instead of XYZ, you have inside, outside and edge.

        Do you want it for n-sided polygons, or do have restricted cases?

        Edit, this is probably what you want Asher. They've got the functions here.

        http://web2.uwindsor.ca/math/hlynka/Ngon.pdf
        Originally posted by Ben Kenobi
        You only need 2-d rather than 3 d? That makes it quite a bit easier.
        Originally posted by Ben Kenobi
        You could say thank you.

        Check the link. They should have what you need. Searching for n-polygon functions polar coordinates should get you what you need.
        Originally posted by Ben Kenobi
        [r1r2sin(theta2-theta1) + r2r3sin(theta3-theta2) + r3r1sin(theta1-theta3)]/2.

        For triangles at arbitrary points P1,P2,P3.
        Originally posted by Ben Kenobi
        Originally posted by Ben Kenobi
        Originally posted by Ben Kenobi
        Cool, I'm glad I was on the right track.

        This is actually similar to some stuff we had to do in Astro way back when. We were always working in Polars (RA + Dec).
        KH FOR OWNER!
        ASHER FOR CEO!!
        GUYNEMER FOR OT MOD!!!

        Comment


        • #49
          12-17-10 Mohamed Bouazizi NEVER FORGET
          Stadtluft Macht Frei
          Killing it is the new killing it
          Ultima Ratio Regum

          Comment


          • #50
            Originally posted by KrazyHorse View Post
            I agree with this. Given that it's impossible to actually do distance-preserving conformal scalings, pretty much anything which gives a reasonable answer would be acceptable.
            Totally. Ignore the sphere.

            Also, the person who defined how it should work is a moron.
            Jon Miller: MikeH speaks the truth
            Jon Miller: MikeH is a shockingly revolting dolt and a masturbatory urine-reeking sideshow freak whose word is as valuable as an aging cow paddy.
            We've got both kinds

            Comment


            • #51
              New problem, related to the original and also related to my thread ranting about the idiot I had yesterday.

              The server-side idiots are sending me a randomly-ordered array of points that forms the polygon. All of my code is dependent on a coherent order, clockwise (CW) or counterclockwise (CCW).

              Spent a bit of this morning trying to solve this myself. It involved computing surface normals and the midpoint. That'd give me an orthonormal basis for creating angles and sorting them. Using the midpoint and the array of angles, I could probably figure out the ordering. But this started making my head hurt, and I figured this problem must've been solved before in computer graphics.

              I ran across the Graham Scan algorithm which I think suits my purposes: http://en.wikipedia.org/wiki/Graham_scan . It'll give me the convex hull of a set of points.

              Again, lucky me gets to do this in Javascript client-side because the server-side guys -- where this should be done -- are epicly ****ing stupid.
              "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
              Ben Kenobi: "That means I'm doing something right. "

              Comment


              • #52
                Couldn't you just average the points, then order the other points by their angle wrt that point?

                Comment


                • #53
                  I thought of trying that a first but I don't think it'd work well because the polygons can be any obscure shape at all. Imagine a thick-shaped "U" with the midpoint in the center.
                  "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
                  Ben Kenobi: "That means I'm doing something right. "

                  Comment


                  • #54
                    I'm trying to explain this to the idiot doing the backend. I sent a lengthy email explaining how and why this is happening.

                    He responded with "What do you mean by clockwise and counterclockwise?"

                    Holy ****ing ****. If I wasn't working from home today I'd probably smack him. I can't take much more of tihs.
                    "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
                    Ben Kenobi: "That means I'm doing something right. "

                    Comment


                    • #55
                      How can you even tell what the polygon is if it's given to you as a randomly-ordered series of point? It's not unique.
                      12-17-10 Mohamed Bouazizi NEVER FORGET
                      Stadtluft Macht Frei
                      Killing it is the new killing it
                      Ultima Ratio Regum

                      Comment


                      • #56
                        That's a good point. It may just be bad data.
                        "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
                        Ben Kenobi: "That means I'm doing something right. "

                        Comment


                        • #57
                          As an example, take 5 points, 4 at the corners of a square, one in the middle of the square. There are 4 "reasonable" distinct polygons you can make out of these points.
                          12-17-10 Mohamed Bouazizi NEVER FORGET
                          Stadtluft Macht Frei
                          Killing it is the new killing it
                          Ultima Ratio Regum

                          Comment


                          • #58
                            This is the polygon data they're sending me.
                            Attached Files
                            "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
                            Ben Kenobi: "That means I'm doing something right. "

                            Comment


                            • #59
                              12-17-10 Mohamed Bouazizi NEVER FORGET
                              Stadtluft Macht Frei
                              Killing it is the new killing it
                              Ultima Ratio Regum

                              Comment


                              • #60
                                There are so many less obtuse ways of doing what you originally stated the problem was that I just can't stop laughing about this.

                                FWIW, I'm pretty sure thy don't actually want the area you've shown on that pic
                                12-17-10 Mohamed Bouazizi NEVER FORGET
                                Stadtluft Macht Frei
                                Killing it is the new killing it
                                Ultima Ratio Regum

                                Comment

                                Working...
                                X