Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Share Your Creations
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Share Your Creations Show your developed application to Basic4ppc community. Please include source code if possible.


Distance Calculator


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-29-2007, 04:18 PM
Junior Member
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 39
Send a message via ICQ to PatrikL Send a message via Skype™ to PatrikL
Default Distance Calculator

This sub is usable in GPS programs -
Code:
Sub Calc
result.Text = sqrt(69.1 * (Lat2.Text - Lat1.Text) * 69.1 * (Lat2.Text - Lat1.Text) + 69.1 * (Lon2.Text - Lon1.Text) * cos(lat1.Text/57.3) * 69.1 * (Lon2.Text - Lon1.Text) * cos(lat1.Text/57.3))
End Sub
(Source: http://www.meridianworlddata.com/Dis...alculation.asp )
- create 5x TextBox - Lat1,2; Lon1,2; result and one Button - Calc
My sample is here:
Attached Files
File Type: zip gpsdistance.zip (109.1 KB, 114 views)

Last edited by PatrikL : 04-29-2007 at 04:22 PM.
Reply With Quote
  #2 (permalink)  
Old 04-29-2007, 06:49 PM
Newbie
 
Join Date: Apr 2007
Posts: 4
Default

Hi PatrikL

very good sample, but what about the direction.


Thanks
shooshan
Reply With Quote
  #3 (permalink)  
Old 04-29-2007, 06:55 PM
Junior Member
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 39
Send a message via ICQ to PatrikL Send a message via Skype™ to PatrikL
Default

Good idea, i try to find formula via google
Reply With Quote
  #4 (permalink)  
Old 04-29-2007, 11:27 PM
Newbie
 
Join Date: Apr 2007
Posts: 4
Default

Quote:
Originally Posted by PatrikL View Post
Good idea, i try to find formula via google
I need

Code:
distanceEast=(Lon2.Text - Lon1.Text) 
distanceNorth=(Lat2.Text - Lat1.Text)
direction= Atan(distanceNorth/distanceEast) Mod (2 * cPI)
direction = (direction)*(180/cPI)
If direction < 0 Then
direction+= 360
  End If
Reply With Quote
  #5 (permalink)  
Old 04-30-2007, 06:07 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 4,831
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

There is no += in Basic4ppc.
Reply With Quote
  #6 (permalink)  
Old 04-30-2007, 02:34 PM
Junior Member
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 39
Send a message via ICQ to PatrikL Send a message via Skype™ to PatrikL
Default

2 sho431
- i try repair that sub, but it don't work
From where is that formula?
Reply With Quote
  #7 (permalink)  
Old 04-30-2007, 05:11 PM
Newbie
 
Join Date: Apr 2007
Posts: 4
Default

Hi



From this
Code:
http://www.tma.dk/gps/#calcdir
Reply With Quote
  #8 (permalink)  
Old 04-30-2007, 05:15 PM
Junior Member
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 39
Send a message via ICQ to PatrikL Send a message via Skype™ to PatrikL
Default

Thanks, i will look at it.
Reply With Quote
Reply


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

vB 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
Calculating distance abastien Code Samples & Tips 8 01-10-2009 08:49 AM
GPS Distance Problem Georg Questions & Help Needed 6 04-25-2008 04:10 AM
Distance-test on UTM and LAT-LON Put Claude Questions & Help Needed 1 10-16-2007 01:06 PM
Distance between UTM zones jerryjukem Questions & Help Needed 3 10-10-2007 10:19 AM
Measuring distance on move Agrartec Code Samples & Tips 15 08-28-2007 01:43 AM


All times are GMT. The time now is 11:57 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0