1 |
REQUIRE "atoms.a4l"; |
2 |
|
3 |
(* |
4 |
simple model for some spherical geometry: latitude and longitude angles |
5 |
subtended by North-South distance (dy) and East-West distance (dx) on |
6 |
a sphere of given radius, given the local latutide (phi) and longitude |
7 |
(theta). |
8 |
|
9 |
The 'on load' configuration of this model gives the dimensions N-S and E-W |
10 |
corresponding to a 1 deg-lat x 1 deg-long square in Sydney. |
11 |
|
12 |
TODO: |
13 |
More useful calculators such as distance between two points, |
14 |
area of trianges, etc. |
15 |
*) |
16 |
MODEL spherical; |
17 |
dx, dy IS_A delta_distance; (* E-W, N-S *) |
18 |
R IS_A distance; |
19 |
|
20 |
phi, theta IS_A angle; (* latitude, longitude *) |
21 |
dphi, dtheta IS_A angle; |
22 |
|
23 |
dx = R*cos(phi)*dtheta; |
24 |
dy = R*dphi; |
25 |
METHODS |
26 |
METHOD on_load; |
27 |
RUN default_self; RUN reset; RUN values; |
28 |
END on_load; |
29 |
METHOD default_self; |
30 |
R := 1 {m}; |
31 |
theta := 0{deg}; phi := 0{deg}; |
32 |
dtheta := 1{deg}; dphi := 1{deg}; |
33 |
END default_self; |
34 |
METHOD specify; |
35 |
FIX R,theta,phi,dtheta,dphi; |
36 |
END specify; |
37 |
METHOD values; |
38 |
R := 6372.795477598 {km}; (* earth's quadratic mean radius *) |
39 |
theta := -33.9189{deg}; |
40 |
phi := 151.2295{deg}; |
41 |
END values; |
42 |
END spherical; |