FMS  2024.03
Flexible Modeling System
mosaic_util.c File Reference

(f703b82972701a4e32a46d4d44a15f9fc2debb27)

Error handling and other general utilities for mosaic_mod. More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "mosaic_util.h"
#include "constant.h"
Include dependency graph for mosaic_util.c:

Go to the source code of this file.

Macros

#define EPSLN10   (1.e-10)
 
#define EPSLN15   (1.e-15)
 
#define EPSLN30   (1.e-30)
 
#define EPSLN8   (1.e-8)
 
#define HPI   (0.5*M_PI)
 
#define MAXNODELIST   100
 
#define TOLORENCE   (1.e-6)
 
#define TPI   (2.0*M_PI)
 

Functions

void addEnd (struct Node *list, double x, double y, double z, int intersect, double u, int inbound, int inside)
 
int addIntersect (struct Node *list, double x, double y, double z, int intersect, double u1, double u2, int inbound, int is1, int ie1, int is2, int ie2)
 
void addNode (struct Node *list, struct Node inNode)
 
double avgval_double (int size, const double *data)
 
double box_area (double ll_lon, double ll_lat, double ur_lon, double ur_lat)
 
void copyNode (struct Node *node_out, struct Node node_in)
 
int delete_vtx (double x[], double y[], int n, int n_del)
 
double dot (const double *p1, const double *p2)
 
void error_handler (const char *msg)
 
int fix_lon (double x[], double y[], int n, double tlon)
 
void getCoordinate (struct Node node, double *x, double *y, double *z)
 
void getCoordinates (struct Node *node, double *p)
 
int getFirstInbound (struct Node *list, struct Node *nodeOut)
 
int getInbound (struct Node node)
 
struct Node * getLast (struct Node *list)
 
struct Node * getNext ()
 
struct Node * getNextNode (struct Node *list)
 
struct Node * getNode (struct Node *list, struct Node inNode)
 
double great_circle_area (int n, const double *x, const double *y, const double *z)
 
double great_circle_distance (double *p1, double *p2)
 
double gridArea (struct Node *grid)
 
void initNode (struct Node *node)
 
int insert_vtx (double x[], double y[], int n, int n_ins, double lon_in, double lat_in)
 
void insertIntersect (struct Node *list, double x, double y, double z, double u1, double u2, int inbound, double x2, double y2, double z2)
 
int inside_a_polygon (double *lon1, double *lat1, int *npts, double *lon2, double *lat2)
 
int inside_a_polygon_ (double *lon1, double *lat1, int *npts, double *lon2, double *lat2)
 
int insidePolygon (struct Node *node, struct Node *list)
 
int intersect_tri_with_line (const double *plane, const double *l1, const double *l2, double *p, double *t)
 
int intersectInList (struct Node *list, double x, double y, double z)
 
int invert_matrix_3x3 (long double m[], long double m_inv[])
 
int isInside (struct Node *node)
 
int isIntersect (struct Node node)
 
void latlon2xyz (int size, const double *lon, const double *lat, double *x, double *y, double *z)
 
int length (struct Node *list)
 
double maxval_double (int size, const double *data)
 
double metric (const double *p)
 
double minval_double (int size, const double *data)
 
void mult (long double m[], long double v[], long double out_v[])
 
int nearest_index (double value, const double *array, int ia)
 
void normalize_vect (double *e)
 
double poly_area (const double x[], const double y[], int n)
 
double poly_area_dimensionless (const double x[], const double y[], int n)
 
double poly_area_no_adjust (const double x[], const double y[], int n)
 
void printNode (struct Node *list, char *str)
 
void rewindList (void)
 
int sameNode (struct Node node1, struct Node node2)
 
int samePoint (double x1, double y1, double z1, double x2, double y2, double z2)
 
void setCoordinate (struct Node *node, double x, double y, double z)
 
void setInbound (struct Node *interList, struct Node *list)
 
double spherical_angle (const double *v1, const double *v2, const double *v3)
 
double spherical_excess_area (const double *p_ll, const double *p_ul, const double *p_lr, const double *p_ur, double radius)
 
void tokenize (const char *const string, const char *tokens, unsigned int varlen, unsigned int maxvar, char *pstring, unsigned int *const nstr)
 
void unit_vect_latlon (int size, const double *lon, const double *lat, double *vlon, double *vlat)
 
void v_print (double x[], double y[], int n)
 
void vect_cross (const double *p1, const double *p2, double *e)
 
void xyz2latlon (int np, const double *x, const double *y, const double *z, double *lon, double *lat)
 

Variables

int curListPos =0
 
struct Node * nodeList =NULL
 

Detailed Description

Error handling and other general utilities for mosaic_mod.

Definition in file mosaic_util.c.