Download the free trial version
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Share Your Creations
Documentation Wiki Register Members List B4P 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, 05:18 PM
Knows the basics
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 51
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, 130 views)

Last edited by PatrikL : 04-29-2007 at 05:22 PM.
Reply With Quote
  #2 (permalink)  
Old 04-29-2007, 07: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, 07:55 PM
Knows the basics
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 51
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-30-2007, 12:27 AM
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, 07:07 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 12,926
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

There is no += in Basic4ppc.
Reply With Quote
  #6 (permalink)  
Old 04-30-2007, 03:34 PM
Knows the basics
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 51
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, 06: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, 06:15 PM
Knows the basics
 
Join Date: Apr 2007
Location: Slovakia, Martin
Posts: 51
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating distance abastien Code Samples & Tips 8 01-10-2009 09:49 AM
GPS Distance Problem Georg Questions (Windows Mobile) 6 04-25-2008 05:10 AM
Distance-test on UTM and LAT-LON Put Claude Questions (Windows Mobile) 1 10-16-2007 02:06 PM
Distance between UTM zones jerryjukem Questions (Windows Mobile) 3 10-10-2007 11:19 AM
Measuring distance on move Agrartec Code Samples & Tips 15 08-28-2007 02:43 AM


All times are GMT. The time now is 02:46 PM.


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