MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Calculating radius width

This is a discussion on Calculating radius width within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-02-2006
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 12-02-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
calculating, radius, width


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/calculating-radius-width-5428.html

Posted By For Type Date
MapPoint Help - MP2K Magazine This thread Refback 12-06-2006 07:49 AM
Map Visitors - Powered by Virtual Earth This thread Refback 12-04-2006 03:31 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Column width in tables baranivis MapPoint 2006/2009 Discussion 7 06-13-2006 04:08 PM
Control Height and Width of images saved using MapPoint lib kdulaney MapPoint 2006/2009 Discussion 3 02-14-2005 06:39 PM
Controling Width of line Anonymous MapPoint 2006/2009 Discussion 1 11-23-2004 12:43 AM
Calculating distances from a route Anonymous MapPoint 2006/2009 Discussion 0 07-18-2003 12:23 PM
How do i change the default Line draw width (toolb.... Anonymous MapPoint 2006/2009 Discussion 1 12-26-2001 12:39 PM


All times are GMT -5. The time now is 10:05 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54