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 8696671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:19:44+00:00 2026-06-13T01:19:44+00:00

I have been able to draw an ellipse on my map using latitude and

  • 0

I have been able to draw an ellipse on my map using latitude and longitude values around a given center point. Although I see a shape on the map, I get an ellipse instead of a circle and I don’t think it matches the distance specified. I intend to use this to display objects within that circle (this will be done later on once I can get the circle displaying properly, which is the reason why i need a circle not an ellipse as it should be perfectly round).

I am using a Bing Maps API. I wish to draw the circle in a given miles (distance) from the center which has been passed in through the parameter, the other variable in the parameter called miles is just holding a double value of 1D. I think the problem is to do with the way my maths is being calculated. Has anyone got a clue on how I can refine this code to calculate my miles better.

private void drawPoly(SearchLocation center, Double miles)
{
//amount of vertex
double vertexCount = 100D;
         //used by the api to carried out searches
List<SearchLocation> vertices = new List<SearchLocation>();
double v = 0;
double radians = Math.PI / 180D;
double radiansPerDegree = Math.PI / 180D;
double degreePerVertex = 360D / vertexCount;
double radiansPerVertex = degreePerVertex * radiansPerDegree;
var centerOfMap = center;
const double degLatMiles = 68.68637156368D;
double degLonMiles = Math.Cos(center.Latitude.Value) * (68.68637156368D);
double milesLat = (miles * degLatMiles) / 3600;
double milesLon = (miles * degLonMiles) / 3600;
for (v = 0; v < vertexCount; v++)
{
    radians = v * radiansPerVertex;
               //adds the miles from the center point and draws a circle
    double centrLat = center.Latitude.Value + (milesLat * Math.Sin(radians));
    double centrLon = center.Longitude.Value + (milesLon * Math.Cos(radians));
    vertices.Add(new SearchLocation() { Latitude = centrLat, Longitude = centrLon });
}
  • 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-13T01:19:46+00:00Added an answer on June 13, 2026 at 1:19 am

    Ok, I’ve misundestood your question. This should work :

        /// <summary>
        /// Calculates the end-point from a given source at a given range (meters) and bearing (degrees).
        /// This methods uses simple geometry equations to calculate the end-point.
        /// </summary>
        /// <param name="source">Point of origin</param>
        /// <param name="range">Range in meters</param>
        /// <param name="bearing">Bearing in degrees</param>
        /// <returns>End-point from the source given the desired range and bearing.</returns>
        public static PointLatLng CalculateDerivedPosition(PointLatLng source, double range, double bearing)
        {
            double latA = source.Lat * DEGREES_TO_RADIANS;
            double lonA = source.Lng * DEGREES_TO_RADIANS;
            double angularDistance = range / EARTH_RADIUS_M;
            double trueCourse = bearing * DEGREES_TO_RADIANS;
    
            double lat = Math.Asin(
                Math.Sin(latA) * Math.Cos(angularDistance) +
                Math.Cos(latA) * Math.Sin(angularDistance) * Math.Cos(trueCourse));
    
            double dlon = Math.Atan2(
                Math.Sin(trueCourse) * Math.Sin(angularDistance) * Math.Cos(latA),
                Math.Cos(angularDistance) - Math.Sin(latA) * Math.Sin(lat));
    
            double lon = ((lonA + dlon + Math.PI) % (Math.PI * 2)) - Math.PI;
    
            return new PointLatLng(
                lat / DEGREES_TO_RADIANS,
                lon / DEGREES_TO_RADIANS);
        }
    

    Juste take your center as source :

    for (int i = 0; i < 360; i++)
    {
      vertices.Add(CalculateDerivedPosition(center, circleRadius, i));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have been able to extract a VARCHAR to a date using string_to_date
I have been using afreechart to draw a few charts in my app, but
I have been able to use MapActivity and ItemizedOverlay to draw overlays on google
I have been able to run my C# .net 3.5 app just fine on
I have been able to make my photos large for single photo posts on
I have been able to find lots of examples of adding a Dropdown list
I have been able to design my layout so that it has 2 columns
I have been able to set up OBDC in Filemaker, and added table ,
I have been trying different things and still have been able to get exactly
What I have been able to grasp from reading the source and documentation from

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.