Announcement

Collapse
No announcement yet.

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

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

  • #16
    Originally posted by Ben Kenobi View Post
    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
    They are n-sided polygons. As the users will create them, they can be arbitrarily complex.

    That PDF seems to be about creating random points within a polygon, from what I read from skimming.
    "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


    • #17
      [r1r2sin(theta2-theta1) + r2r3sin(theta3-theta2) + r3r1sin(theta1-theta3)]/2.

      For triangles at arbitrary points P1,P2,P3.
      Scouse Git (2) La Fayette Adam Smith Solomwi and Loinburger will not be forgotten.
      "Remember the night we broke the windows in this old house? This is what I wished for..."
      2015 APOLYTON FANTASY FOOTBALL CHAMPION!

      Comment


      • #18


        This may also be helpful.
        Scouse Git (2) La Fayette Adam Smith Solomwi and Loinburger will not be forgotten.
        "Remember the night we broke the windows in this old house? This is what I wished for..."
        2015 APOLYTON FANTASY FOOTBALL CHAMPION!

        Comment


        • #19
          Eigenvalues, holy ****. Blast from 2001.
          "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


          • #20


            This may also help too.
            Scouse Git (2) La Fayette Adam Smith Solomwi and Loinburger will not be forgotten.
            "Remember the night we broke the windows in this old house? This is what I wished for..."
            2015 APOLYTON FANTASY FOOTBALL CHAMPION!

            Comment


            • #21
              In units of the radius of the earth (i.e. dealing with the unit sphere, and converting to radians) I've got

              Code:
              (latC, longC) = center
              (latG, longG) = given
              d = some_flavor_of_acos(sin(latC)sin(latG)(cos(longC)cos(longG) - sin(longC)sin(longG)) + cos(latC)cos(latC))
              by converting to cartesian coordinates and taking the dot product.

              We now want to solve for the point (latN,longN) = new such that dist(new,center) = scale*d, and such that dist(new,given) = (scale-1)*d.

              Note: I don't understand why in the OP you assuming you'll be able to construct a right triangle using this three points.

              edit: also, this is all probably pointless because KH knows the formula for this in his sleep

              Comment


              • #22
                I can always construct a right triangle.

                pointC (centre)
                pointG (given)
                pointI (imaginary)

                the imaginary point would be constructed like so: pointC.lat, pointG.long

                It'll create a right triangle every time, with the hypotenuse being the distance between pointC and pointG
                "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


                • #23
                  Ooh, I thought you were trying to construct the new scaled point.

                  Comment


                  • #24
                    By the way, as it turns out actually solving my system of equations kind of sucks.

                    Comment


                    • #25
                      Originally posted by Kuciwalker View Post
                      Ooh, I thought you were trying to construct the new scaled point.
                      Nope, I was creating the right triangle 'cause I thought it'd be easiest to leverage trig to determine the new point (and it would be in a true Cartesian plane).

                      FWIW I found this formula that supposedly determines a lat/long of a point given an origin point, radial, and distance. But when I implemented it in JS, it gave me bizarre and obviously incorrect results:

                      Code:
                      lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))
                      
                      dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin(lat1)*sin(lat))
                      
                      lon= (lon1-dlon +pi) % (2*pi) )-pi
                      Where lat1/lon1 and lat2/lon2 are the centroid and given point, respectively, d is the distance between the centroid and given point, and "tc" is the radial.
                      "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


                      • #26
                        Always make sure you are using the correct asin/acos/atan (in terms of domain and range).

                        Comment


                        • #27
                          I'm grammar more better at.

                          Comment


                          • #28
                            Originally posted by Kitschum View Post
                            I'm grammar more better at.
                            Finally, something in this thread that makes sense.
                            Captain of Team Apolyton - ISDG 2012

                            When I was younger I thought curfews were silly, but now as the daughter of a young woman, I appreciate them. - Rah

                            Comment


                            • #29
                              It looks like this should work...

                              Definitions:
                              Centroid (Lat1, Lon1)
                              Bearing (theta)
                              distance (d): angular distance in radians
                              radius (R): earth's radius

                              Code:
                              Lat2 = asin(sin(Lat1) * cos(d/R) + cos(Lat1) * sin(d/R) * cos(theta))
                              
                              Lon2 = Lon1 + atan2(sin(theta) * sin(d/R) * cos(Lat1), cos(d/R) - sin(Lat1) * sin(Lat2))
                              Will try it out tomorrow.
                              "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


                              • #30
                                Asher, I'm not sure your problem is well-formulated....

                                An example for why I say this is as follows: Take as your polygon a square "centered" at the north pole with "radius" (distance from north pole to each vertex) of pi/2*R where R is the Earth's radius

                                First off, the location of the "centroid" is ambiguous; is it the north pole or the south pole?

                                Secondly, if you "double" this polygon you either end up with 4 overlapping points at the south pole (if you assumed the original polygon was centered at the north pole) or at the north pole (if you assumed a center at the south pole)

                                Either way, the side lengths have shrunk under a "doubling".

                                For less extreme cases, it is ALWAYS true that "doubling" the polygon using the method you claim here will scale the side lengths by a factor LESS than 2. This is because a sphere is a surface of constant positive curvature. More worryingly, the side lengths will all change by different factors (sides closer to the centroid will increase in length more than sides far from the centroid)

                                In other words, if I "double" an equilateral triangle of sides 500 km I will end up, using your method, with a triangle of sides less than 1000 km, and for more complex figures not even the ratio of side lengths is constant.

                                What is the purpose of this function? We need to know what the appropriate sense of "scale" is; is it side lengths? Is it "radius"? Is it something else?
                                Last edited by KrazyHorse; November 26, 2009, 05:44.
                                12-17-10 Mohamed Bouazizi NEVER FORGET
                                Stadtluft Macht Frei
                                Killing it is the new killing it
                                Ultima Ratio Regum

                                Comment

                                Working...
                                X