helloo,
ONLY READ FURTHER IF YOU ARE ALREADY BORED, I TAKE NO RESPONSIBILITY FOR
INDUCED SOMNAMBULISM.
can anyone tell me how stupid i am? this isn't a necessary function of my
program, just a nice add-on, but can anyone tell me if my calculations are
correct or not.
given a start X / Y and an end X / Y i want to calculate a bearing. please
bear with me, i am in the southern hemisphere so this may be backwards for
many of you.
' Centre of Adelaide, the city that always sleeps
StartX = 138.6
StartY = -34.9288
' my girlfriends place
EndX = 138.59143
EndY = -34.909724
'the number of metres in a degrees of longitude/latitude in the general
Adelaide area, good enough for small calculations on a flat-earth model
Xpants = 91163.74274
Ypants = 111198.3871
'DISTANCE between Start and End
Square Root of
((( StartX - EndX ) * Xpants ) ^ 2 )
+
((( StartY - EndY ) * Ypants ) ^ 2 )
DISTANCE = 2260 metres
'RADIANS from start to end
ASIN of
((( EndY - StartY ) * Ypants ) / DISTANCE )
RADIANS = 1.2179
'convert to DEGREES
RADIANS * 180 / Pi
DEGREES = 69.78
'then werk out the final answer
if StartX < EndX then 'if start point is west of end point
90 - DEGREES = 20.219
elseif StartX > EndX then 'if start point is east of end point
360 - ( 90 - DEGREES ) = 339.78
end if
in this case the start point is east of the end point, so the final answer
is 339.78 degrees, which when looked at on a map, seems correct.
if there is an easier way to do this then please let me know, but now i'm
trying to make a function in VBA which does all this, and i hit a wall when
it comes to the ASIN function, a derived function which is defined in Excel
but not in Access.
so does anyone know how to do the arcsine calculation in Access/VB? it's
probably really easy, but i'm no trig guru, i really struggled to get this
far.
gramercy
ash
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2329