SUBROUTINE CDCLFN ( * * inputs * : VAR, COEFF, * * outputs * : F0, FVAR, FCOEFF) * * Module number: * * Module name: * * Keyphrase: * ---------- * Calculate functional values and derivatives of a circle. * * Description: * ------------ * For the function: * * F = (X - x0)^2 + (Y - y0)^2 - r^2 * * calculate the functional value F0, for given x0, y0, r, X, and Y. Also * calculate the partial derivatives of F relative to x0, y0, and r * (coefficents) and X, and Y (variables). * * COEFF(1) = x0, COEFF(2) = y0, COEFF(3) = r, VAR(1) = X, VAR(2) = Y * * FORTRAN name: CDCLFN.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * None * * Subroutines Called: * ------------------- * CDBS: * None * SDAS: * None * Others: * None * * History: * -------- * Version Date Author Description * 1 02-16-87 J.-C. HSU design and coding * *------------------------------------------------------------------------------- * *== input: * --observed variables at a given point * --(e. g. X and Y coordinates) DOUBLE PRECISION VAR(*), * --coefficients in the given function : COEFF(*) * *== output: * --functional value DOUBLE PRECISION F0, * --partial derivativeS relative to the * --variables and coefficients : FVAR(*), FCOEFF(*) * *------------------------------------------------------------------------------ * * functional value * F0 = (VAR(1) - COEFF(1)) ** 2 + (VAR(2) - COEFF(2)) ** 2 - : COEFF(3) ** 2 * * partial derivatives relative to the variables * FVAR(1) = 2.D0 * (VAR(1) - COEFF(1)) * FVAR(2) = 2.D0 * (VAR(2) - COEFF(2)) * * partial derivatives relative to the coefficients * FCOEFF(1) = -FVAR(1) * FCOEFF(2) = -FVAR(2) * FCOEFF(3) = -2.D0 * COEFF(3) * RETURN END