Click here to Skip to main content
15,914,905 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: delimitted files Pin
Andy_L_J18-Mar-10 8:54
Andy_L_J18-Mar-10 8:54 
AnswerRe: delimitted files Pin
Mycroft Holmes16-Mar-10 20:59
professionalMycroft Holmes16-Mar-10 20:59 
QuestionAccess textboxes - Dynamically created Tab Pin
dotnetme216-Mar-10 9:27
dotnetme216-Mar-10 9:27 
AnswerRe: Access textboxes - Dynamically created Tab Pin
Luc Pattyn16-Mar-10 10:25
sitebuilderLuc Pattyn16-Mar-10 10:25 
GeneralRe: Access textboxes - Dynamically created Tab Pin
dotnetme216-Mar-10 11:00
dotnetme216-Mar-10 11:00 
GeneralRe: Access textboxes - Dynamically created Tab Pin
Luc Pattyn16-Mar-10 11:06
sitebuilderLuc Pattyn16-Mar-10 11:06 
QuestionMS Graph Chart - horizontal bar chart Pin
john john mackey16-Mar-10 7:33
john john mackey16-Mar-10 7:33 
Questionhow to find a lat/log at a given distance from a given lat/log Pin
Preeti197916-Mar-10 6:48
Preeti197916-Mar-10 6:48 
I have a problem . I have to draw a circle at a particular distance say 50 meters from a given lat/log.I refered to Aviation formula's and find a formula to calculate lat/log at a distance and
at a bearing which is as follows:-

A point {lat,lon} is a distance d out on the tc radial from point 1 if:

lat=asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos
(tc))
IF (cos(lat)=0)
lon=lon1 // endpoint a pole
ELSE
lon=mod(lon1-asin(sin(tc)*sin(d)/cos
(lat))+pi,2*pi)-pi
ENDIF

This algorithm is limited to distances such that dlon <pi/2, i.e those that extend around less
than one quarter of the circumference of the earth in longitude. A completely general, but more complicated algorithm is necessary if greater distances are allowed:

lat =asin(sin(lat1)*cos(d)+cos(lat1)*sin(d)*cos(tc))

dlon=atan2(sin(tc)*sin(d)*cos(lat1),cos(d)-sin
(lat1)*sin(lat))

lon=mod( lon1-dlon +pi,2*pi )-pi

for this i have written this coding:-

Private Sub cmdNextPoint_Click()
Dim lat2 As Double, lon2 As Double, theta As Double, d As Double,Aasin As Double,Aatan2 As Double
Pi = 3.14159265358979
d = 50
theta = 90 * 0.0174532925
txtLatitude.Text = 22.51791
txtLongitude.Text = 87.46598
Aasin = Sin(Val(txtLatitude.Text)) * Cos(d) + Cos(Val(txtLatitude.Text)) * Sin(d) * Cos(theta)
lat2 = atan2(Aasin, Sqr(1 - Aasin * Aasin))
Aatan2 = Sin(theta) * Sin(d) * Cos(Val(txtLatitude.Text))
Batan2 = Cos(d) - Sin(Val(txtLatitude.Text)) * Sin(lat2)
lon2 = ((Val(txtLongitude.Text) - atan2(Aatan2, Batan2) + Pi) Mod (2 * Pi)) - Pi
txtLatitude2.Text = lat2
txtLongitude2.Text = lon2
End Sub


Public Function atan2(ByVal y As Double, ByVal x As Double) As Double
If y > 0 Then
If x >= y Then
atan2 = Atn(y / x)
ElseIf x <= -y Then
atan2 = Atn(y / x) + Pi
Else
atan2 = Pi / 2 - Atn(x / y)
End If
Else
If x >= -y Then
atan2 = Atn(y / x)
ElseIf x <= y Then
atan2 = Atn(y / x) - Pi
Else
atan2 = -Atn(x / y) - Pi / 2
End If
End If
End Function


in this i m finding a point which is at a distance of 50 meters from the latitude 22.51791 and longitude 87.46598 and at a bearing of 90 degrees.Somebody told me that to draw a circle i have to find out 360 points then by using the DrawPolygon method the circle can be drawn.So firstly i m finding one point.It is not giving me the desired result that should be latitude = 22.51841 and longitude = 87.46598.Can anybody help me .Just tell me where i m wrong.I m using the mapwingis activex control to display the map.
AnswerRe: how to find a lat/log at a given distance from a given lat/log Pin
Luc Pattyn16-Mar-10 7:57
sitebuilderLuc Pattyn16-Mar-10 7:57 
AnswerRe: how to find a lat/log at a given distance from a given lat/log Pin
Dave Kreskowiak16-Mar-10 8:02
mveDave Kreskowiak16-Mar-10 8:02 
QuestionData Grid View-Visual studio - 2008(Vb.net) [modified] Pin
Ganesh Joshi16-Mar-10 2:59
Ganesh Joshi16-Mar-10 2:59 
AnswerRe: Data Grid View Pin
εїзεїзεїз17-Mar-10 6:44
εїзεїзεїз17-Mar-10 6:44 
Questionautomation in vb Pin
sowjanya316-Mar-10 0:20
sowjanya316-Mar-10 0:20 
AnswerRe: automation in vb Pin
Wayne Gaylard16-Mar-10 0:37
professionalWayne Gaylard16-Mar-10 0:37 
AnswerRe: automation in vb Pin
dan!sh 16-Mar-10 0:41
professional dan!sh 16-Mar-10 0:41 
GeneralRe: automation in vb Pin
sowjanya316-Mar-10 0:45
sowjanya316-Mar-10 0:45 
GeneralRe: automation in vb Pin
dan!sh 16-Mar-10 0:47
professional dan!sh 16-Mar-10 0:47 
GeneralRe: automation in vb Pin
sowjanya316-Mar-10 17:44
sowjanya316-Mar-10 17:44 
GeneralRe: automation in vb Pin
sowjanya316-Mar-10 17:48
sowjanya316-Mar-10 17:48 
GeneralRe: automation in vb Pin
Anubhava Dimri16-Mar-10 2:02
Anubhava Dimri16-Mar-10 2:02 
AnswerRe: automation in vb Pin
Dalek Dave16-Mar-10 0:59
professionalDalek Dave16-Mar-10 0:59 
QuestionMultithreading Pin
programmervb.netc++15-Mar-10 16:23
programmervb.netc++15-Mar-10 16:23 
AnswerRe: Multithreading Pin
Luc Pattyn15-Mar-10 16:51
sitebuilderLuc Pattyn15-Mar-10 16:51 
GeneralRe: Multithreading Pin
programmervb.netc++15-Mar-10 16:57
programmervb.netc++15-Mar-10 16:57 
GeneralRe: Multithreading Pin
Luc Pattyn15-Mar-10 17:31
sitebuilderLuc Pattyn15-Mar-10 17:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.