Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8157167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:11:20+00:00 2026-06-06T17:11:20+00:00

I have a lat/long coordinate point and I’m drawing a polygon (hexagon) around it

  • 0

I have a lat/long coordinate point and I’m drawing a polygon (hexagon) around it on a Google map. Here’s my code to calculate the hexagon coordinates:

for (var i = 0; i < 6; i++) {
    x =  lat + r * Math.sin(i * 2 * Math.PI / 6);
    y =  lng + r * Math.cos(i * 2 * Math.PI / 6);
}

This calculates all coordinates in a regular hexagon and I can draw it on the map without a problem if its center is near (0 lat, 0 long). The problem is when I want to draw it far from (0, 0) this gets into an elongated shape. I’m guessing it’s because the earth is not flat and Google maps takes that into account. So I probably need to change the radius in my calculation to reflect this, has anyone any idea how it is done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:11:22+00:00Added an answer on June 6, 2026 at 5:11 pm

    Examples of various regular polygons far from (0,0)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this code for reverse geocoding: var point = new GLatLng (lat[1],long[1]);
I have a data set with over 50,000 geocoded points (lat-long). Each point has
I have a map of the USA and a list of long, lat that
Given a coordinate (lat, long), I am trying to calculate a square bounding box
I have written this code that loops through an array of lat/long coordinates and
I have 2 coordinates in Lat Long format. How do I determine from Point
I have a method in an API that takes a lat/long coordinate and will
Here I have used google map and an overlay. I have used an image
I have the Lat/Long value of New York City, NY; 40.7560540,-73.9869510 and a flat
I have to work with strings which may contain Lat/Long data, like this: $query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.