Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

Calculating radius width

This is a discussion on Calculating radius width within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi friends, If i draw a radius and i right click,how do i find out programatically,that a particular latitude and ...

  1. #1
    hegdek is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    8

    Calculating radius width

    Hi friends,
    If i draw a radius and i right click,how do i find out programatically,that
    a particular latitude and longitiude falls within the radius.
    regards
    kaushik

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Calculating radius width

    Hi,

    - 1 arc second is exacly 1 sea mile on equator and in latitude
    - in longitude if not on equator multiply with Cos(latitude)

    So you know the center of the circle, and you can calculate the distance.

    Wait, I give you a peace of code that calculate the distance to 2 point. It is in one of my boardcomputers to calculate birds view distance. It is in c but you can easy convert it. Dont mind the bearing, you need de distance:

    Code:
    u_16 get_bearing(double lat1, double lon1, double lat2, double lon2, u_32* miles)
    {
    	double lat  = lat2 - lat1;
    	double lon  = (lon2 - lon1) * cos(deg2rad((lat1 + lat2) / 2));
    	double dist = hypot(lat, lon);
    	double bear = rad2deg(acos(lat / dist));
    	
    	if (nv->par.km)
    		*miles = (u_32)(dist * 60 * 10 * 1.852);
    	else
    		*miles = (u_32)(dist * 60 * 10 * 1.852 / 1.609);
    	
    	if (lon < 0)	// Western direction
    		bear = 360 - bear;
    	return bear;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Control Height and Width of images saved using MapPoint lib
    By kdulaney in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 12-19-2012, 01:52 AM
  2. Column width in tables
    By baranivis in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 06-13-2006, 04:08 PM
  3. Controling Width of line
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-23-2004, 12:43 AM
  4. Calculating distances from a route
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-18-2003, 12:23 PM
  5. How do i change the default Line draw width (toolb....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-26-2001, 12:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25