This isn't an API problem, it's a simple trigonometry problem. Use an arctangent to determine the angle between your point and the center of the circle; that (along with the radius) effectively gives you your edge point in polar coordinates, and you can simply convert that back to the rectangular (cartesian) coordinates we call latitude & longitude. It's more complicated if you need to correct for the map projection, but I'll bet on the scale you're using you won't need to.
String On 14 Nov, 17:24, GG <[email protected]> wrote: > http://brainbackup.net/google-maps/edge-of-circle.php?faux_lat=37.769... > > I need the red line in this map to go to the _edge_ of the circle, not > the center. I have no idea how to calculate that point using gmapsv3. > Here are the steps I need to convert into a function. > > 1) calculate the distance from user_lat/user_long to faux_lat/ > faux_long > 2) subtract the location_radius (which is in miles) from the distance > 3) figure out that point's coordinates > > Can anyone help me with this? Here is what I have so far: > > edgeOfCircle{ > > } > > =) Thanks! -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=.
