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:


IF (cos(lat)=0)
lon=lon1 // endpoint a pole

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))


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
atan2 = Pi / 2 - Atn(x / y)
End If
If x >= -y Then
atan2 = Atn(y / x)
ElseIf x <= y Then
atan2 = Atn(y / x) - Pi
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 may not be understanding something here but once you have that point, that center point that is fifty meters away calculated, then do you not need to draw your circle from there? As most circle drawing methods that I know of use the center point to "center" where the circle is... And then, what I don't understand is why do you need to calculate all 360 degree points of the compass? Perhaps you should go back and ask that person why you need to calculate those extra points???

Good Luck