$
$*********************************************      basic stuff
$
&device -g_default device
&dimen -dimen feet kips
&default -depth 100
$
$*********************************************      read macros
$
&insert sfun.mac
$
$*********************************************      atan
$
&cutype Testing Inverse Trig
&type atan    1      = &number(atan    1 ) radians
&type atan    1/2    = &number(atan    1/2 ) radians
&type atan   -1/2    = &number(atan   -1/2 ) radians
&type atan2   1 2    = &number(atan2   1 2) radians
&type atan2  -1 2    = &number(atan2  -1 2) radians
&type atan2d  1 2    = &number(atan2d  1 2) degrees
&type atan2d -1 2    = &number(atan2d -1 2) degrees
&type acos    .999   = &number(acos    .999 ) radians
&type acos    1/2    = &number(acos    1/2 ) radians
&type acos   -1/2    = &number(acos   -1/2 ) radians
&type asin    .999   = &number(asin    .999 ) radians
&type asin    1/2    = &number(asin    1/2 ) radians
&type asin   -1/2    = &number(asin   -1/2 ) radians
$
$*********************************************      trig
$
&loop fun ( sin cos tan )
   &cutype Testing %fun
   &type %fun 0      = &number(%fun   0 )
   &type %fun 1      = &number(%fun   1 )
   &type %fun pi/2   = &number(%fun   3.1415927/2 )
&endloop
$
$*********************************************      trig
$
&loop fun ( sind cosd  tand )
   &cutype Testing %fun
   &type %fun 0      = &number(%fun   0 )
   &type %fun 45     = &number(%fun   45 )
   &type %fun 90     = &number(%fun   90 )
&endloop
$
$*********************************************      functions
$
&cutype Misc Functions
&type sqrt   2                     = \
        &number(sqrt   2           )
&type log   10                     = \
        &number(log   10          )
&type ln    10                     = \
        &number(ln    10          )
&type exp   1                      = \
        &number(exp   1           )
$
$*********************************************      misc
$
&cutype Testing Misc
&type max 300 2 10 -1 90 30 150)   =  \
        &number(max 300 2 10 -1 90 30 150)
&type min 300 2 10 -1 90 30 150)   =  \
        &number(min 300 2 10 -1 90 30 150)
&type sort 300 2 10 -1 90 30 150)  =  \
        &number(sort 300 2 10 -1 90 30 150)
&type interpolate .5 0 1 2 3       = \
        &number(interpolate .5 0 1 2 3 )
&type interpolate .5 0 1 2 3       = \
        &number(interpolate .5 0 1 2 3 )
&type ?   cow                      = \
        &number(? cow        )
&type integer 2.5                  = \
        &number(integer 2.5  )
&type real 2.5+1                   = \
        &number(real 2.5+1  )
&type mean 0 1 2 3                 = \
        &number(mean 0 1 2 3 )
&type increment 0 10 1             = \
        &number(increment 0 10 1 )
$
$*********************************************      vector
$
&cutype Testing Vectors
&type abs -1 1 -2 -3 -4            = \
        &number(abs -1 1 -2 -3 -4 )
&type unit_vector 1 1              = \
        &number(unit_vector 1 1   )
&type cross  -1 -1 0 2 2 0         = \
        &number(cross  -1 -1 0 2 2 0  )
&type dot  -1 -1 2 2               = \
        &number(dot  -1 -1 2 2    )
&type addv .5 1 1 2 2              = \
        &number(addv .5 1 1 2 2    )
&type scale .5 1 1 2 2             = \
        &number(scale .5 1 1 2 2    )
&type norm 1 1 1                   = \
        &number(norm 1 1 1    )
&set q = &number(3pts2q 0 0 0 \
                        1 1 0 \
                        0 0 1 )
&type 3pts2q                       = %q
&type veclg                        = \
        &number(vecl2g  %q 1 0 0 )
&type vecg2l                       = \
        &number(vecg2l  %q 1 0 0 )
$
$*********************************************      all done
$
&fini
