I am getting here into an area I have not tried in J before.
The following code I managed to create by stealing quite heavily from the
cities demo.
sin=: 1&o.
cos=: 2&o.
arccos=: _2&o.
RADIUS=: 6371.007 NB. km
LAT1=: 1r10800p1 * 60 #. 64 9
LON1=: 1r10800p1 * 60 #. _21 _57
LAT2=: 1r10800p1 * 60 #. 64 17
LON2=: 1r10800p1 * 60 #. _15 _13
SINLAT1=: sin LAT1
COSLAT1=: cos LAT1
SINLAT2=: sin LAT2
COSLAT2=: cos LAT2
<.0.5+RADIUS*arccos (SINLAT1*SINLAT2)+(COSLAT1*COSLAT2)*cos(LON2)-LON1
326
So now I know there are 326 km between these two places.
Now I would like to do it the other way around.
a) When at pos1 give a direction and distance like a ring say 1 km in radius
and get 10 points on the perifery of the ring all around.
b) If I have a list of coordinates to find all coordinates within the circle
in a)
c) I am curious of what this number 1r10800p1 is all about.
--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf,
Þerneyjarsundi 23, Hraunborgum
Po Box 127,801 Selfoss ,
t-póst: [email protected]
gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming
Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
góður kennari getur stigið á tær án þess að glansinn fari af skónum
/|_ .-----------------------------------.
,' .\ / | Með léttri lund verður |
,--' _,' | Dagurinn í dag |
/ / | Enn betri en gærdagurinn |
( -. | `-----------------------------------'
| ) | (\_ _/)
(`-. '--.) (='.'=) ♖♘♗♕♔♙
`. )----' (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm