include # defines DEGTORAD include "fitxy.h" # defines NV, XY_SAME, XY_OPPOSITE, etc # evalxy -- evaluate the fit from fitxy # # Phil Hodge, 11-Sep-1992 Task created. # Phil Hodge, 26-Jan-1994 Include parity parameter. procedure evalxy() double x, y # input coordinates double scale, angle # coefficients of fit int parity # same or opposite parity pointer sparity # scratch for "same" or "opposite" #-- pointer sp double coeff[NV] # coefficients of the fit: c, s, v2_0, v3_0 double v2, v3 double clgetd() int clgwrd() begin call smark (sp) call salloc (sparity, SZ_FNAME, TY_CHAR) # Get parameters. Note that parity and the coefficients must be # consistent with the corresponding variables in fitxy. x = clgetd ("x") y = clgetd ("y") # The order of these values is defined in fitxy.h. parity = clgwrd ("parity", Memc[sparity], SZ_FNAME, "|same|opposite") scale = clgetd ("scale") angle = clgetd ("angle") angle = DEGTORAD(angle) COS_ANGLE(coeff) = scale * cos (angle) SIN_ANGLE(coeff) = scale * sin (angle) V2_ZERO(coeff) = clgetd ("v2_0") V3_ZERO(coeff) = clgetd ("v3_0") # Evaluate the fit at (x,y). call sr_eval (x, y, parity, coeff, v2, v3) call clputd ("v2", v2) call clputd ("v3", v3) call printf ("%15.7g %15.7g %15.7g %15.7g\n") call pargd (x) call pargd (y) call pargd (v2) call pargd (v3) call sfree (sp) end