real function acc(theta) real theta real H,L H=2.0 !mm L=20.0 !mm tant=abs(tan(theta)) if (L*tant.gt.H) then acc=0.5*H**2/tant else acc=L*(H-0.5*L*tant) endif end real function acc2(theta) real theta real H,L H=2.0 !mm L=20.0 !mm tant=abs(tan(theta)) if (2*H/tant.lt.L) then acc2=H**2/tant else if (2*H/tant.gt.L .and. H/tant.lt.L) then acc2=H**2/tant-0.5*tant*(2*H/tant-L)**2 else acc2=0.5*L**2*tant endif end