libfuns.pl
changeset 51 14ce2387de5e
parent 36 04e8cb4f8073
equal deleted inserted replaced
50:4b59a02e6518 51:14ce2387de5e
     1 #======================================================================
     1 #======================================================================
     2 #                    L I B F U N S . P L 
     2 #                    L I B F U N S . P L 
     3 #                    doc: Wed Mar 24 11:49:13 1999
     3 #                    doc: Wed Mar 24 11:49:13 1999
     4 #                    dlm: Fri May 11 11:40:05 2018
     4 #                    dlm: Sat Jun 25 21:11:48 2022
     5 #                    (c) 1999 A.M. Thurnherr
     5 #                    (c) 1999 A.M. Thurnherr
     6 #                    uE-Info: 31 77 NIL 0 0 70 2 2 4 NIL ofnI
     6 #                    uE-Info: 20 34 NIL 0 0 70 2 2 4 NIL ofnI
     7 #======================================================================
     7 #======================================================================
     8 
     8 
     9 # HISTORY:
     9 # HISTORY:
    10 #	Mar 24, 1999: - copied from the c-version of NR
    10 #	Mar 24, 1999: - copied from the c-version of NR
    11 #	Mar 26, 1999: - added stuff for better [./fit]
    11 #	Mar 26, 1999: - added stuff for better [./fit]
    15 #	Apr 16, 2010: - added sinc()
    15 #	Apr 16, 2010: - added sinc()
    16 #	Sep  7, 2012: - added acosh()
    16 #	Sep  7, 2012: - added acosh()
    17 #	Jun  4, 2015: - added gaussRand()
    17 #	Jun  4, 2015: - added gaussRand()
    18 #			 	  - made normal() more efficient
    18 #			 	  - made normal() more efficient
    19 #	May 11, 2018: - added Nsq()
    19 #	May 11, 2018: - added Nsq()
       
    20 #	Jun 25, 2022: - added interp()
    20 
    21 
    21 require	"$ANTS/libvec.pl";								# rad()
    22 require	"$ANTS/libvec.pl";								# rad()
       
    23 
       
    24 #----------------------------------------------------------------------
       
    25 # Linear Interpolation
       
    26 #----------------------------------------------------------------------
       
    27 
       
    28 sub interp($$$)
       
    29 {
       
    30 	my($x1,$x2,$frac) = @_;
       
    31 	return $x1 + $frac * ($x2-$x1);
       
    32 }
    22 
    33 
    23 #----------------------------------------------------------------------
    34 #----------------------------------------------------------------------
    24 # Buoyancy-Freuquency Squared
    35 # Buoyancy-Freuquency Squared
    25 #	- based on signed buoyancy frequency => propagate sign
    36 #	- based on signed buoyancy frequency => propagate sign
    26 #----------------------------------------------------------------------
    37 #----------------------------------------------------------------------