/[ascend]/trunk/models/johnpye/spherical.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/spherical.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 820 - (show annotations) (download) (as text)
Thu Aug 17 05:45:27 2006 UTC (14 years, 1 month ago) by johnpye
File MIME type: text/x-ascend
File size: 1002 byte(s)
A little sample calculation
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 MODEL spherical;
13 dx, dy IS_A delta_distance; (* E-W, N-S *)
14 R IS_A distance;
15
16 phi, theta IS_A angle; (* latitude, longitude *)
17 dphi, dtheta IS_A angle;
18
19 dx = R*cos(phi)*dtheta;
20 dy = R*dphi;
21 METHODS
22 METHOD on_load;
23 RUN default_self; RUN reset; RUN values;
24 END on_load;
25 METHOD default_self;
26 R := 1 {m};
27 theta := 0{deg}; phi := 0{deg};
28 dtheta := 1{deg}; dphi := 1{deg};
29 END default_self;
30 METHOD specify;
31 FIX R,theta,phi,dtheta,dphi;
32 END specify;
33 METHOD values;
34 R := 6372.795477598 {km}; (* earth's quadratic mean radius *)
35 theta := -33.9189{deg};
36 phi := 151.2295{deg};
37 END values;
38 END spherical;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22