c $Header: /usr/people/flittner/radtran/tomrad/pv2.2/src/RCS/quadcoe.f,v 2.22 2000/08/30 16:38:09 flittner Exp $ subroutine quadcoe(x,c) c c compute the coefficients of quad. function tabulated at 3 points given c the pts where it is tabulated (the x vector) c c return coef. array such that c f(x)=c(0,0)*f(x(0))+c(1,0)*f(x(1))+c(2,0)*f(x(2)) c +(c(0,1)*f(x(0))+c(1,1)*f(x(1))+c(2,1)*f(x(2)))*x c +(c(0,2)*f(x(0))+c(1,2)*f(x(1))+c(2,2)*f(x(2)))*x*x c c or f(x)= c [f(x0),f(x1),f(x2)] [c00 c01 c02] |1 | c *|c10 c11 c12|*|x | c [c20 c21 c22] |x*x| c implicit none c the rcs revision # character*20 rcsrev parameter (rcsrev='$Revision: 2.22 $') c passed real*8 c(3,3),x(3) c local real*8 a(3) c a(1)=x(3)-x(2) a(2)=x(3)-x(1) a(3)=x(2)-x(1) c c constant term c(1,1)=x(2)*x(3)/a(2)/a(3) c(2,1)=-x(1)*x(3)/a(1)/a(3) c(3,1)=x(1)*x(2)/a(1)/a(2) c c linear term c(1,2)=-(x(3)+x(2))/a(2)/a(3) c(2,2)=(x(3)+x(1))/a(1)/a(3) c(3,2)=-(x(1)+x(2))/a(1)/a(2) c c quad term c(1,3)=1.0/a(2)/a(3) c(2,3)=-1.0/a(1)/a(3) c(3,3)=1.0/a(1)/a(2) return end