00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00027 #ifndef _TESSEROIDS_UTILS_H_
00028 #define _TESSEROIDS_UTILS_H_
00029
00030
00031
00032 #include <stdio.h>
00033
00034
00036 typedef struct tess_struct {
00037
00038 double density;
00039 double w;
00040 double e;
00041 double s;
00042 double n;
00043 double r1;
00044 double r2;
00045 } TESSEROID;
00046
00047
00049 typedef struct prism_struct {
00050 double density;
00051 double x1;
00052 double x2;
00053 double y1;
00054 double y2;
00055 double z1;
00056 double z2;
00057
00058
00059 } PRISM;
00060
00061
00063 typedef struct sphere_struct {
00064 double density;
00065 double r;
00066 double lonc;
00067 double latc;
00068 double rc;
00069 } SPHERE;
00070
00071
00077 extern void split_tess(TESSEROID tess, TESSEROID *split);
00078
00079
00089 extern double tess_total_mass(TESSEROID *model, int size);
00090
00091
00103 extern double tess_range_mass(TESSEROID *model, int size, double low_dens,
00104 double high_dens);
00105
00106
00127 extern void tess2prism(TESSEROID tess, PRISM *prism);
00128
00129
00136 extern void tess2sphere(TESSEROID tess, SPHERE *sphere);
00137
00138
00148 extern void prism2sphere(PRISM prism, double lonc, double latc, double rc,
00149 SPHERE *sphere);
00150
00151
00158 extern double tess_volume(TESSEROID tess);
00159
00160
00167 extern double sphere_volume(SPHERE sphere);
00168
00169
00176 extern double prism_volume(PRISM prism);
00177
00178
00185 extern void strstrip(char *str);
00186
00187
00195 extern int gets_tess(const char *str, TESSEROID *tess);
00196
00197
00207 extern TESSEROID * read_tess_model(FILE *modelfile, int *size);
00208
00209
00217 extern int gets_prism(const char *str, PRISM *prism);
00218
00219
00229 extern PRISM * read_prism_model(FILE *modelfile, int *size);
00230
00231 #endif