
                Bmath v.03.00
                ~~~~~~~~~~~~~
      copyright  2001 by dennis crombie
             (math with Bittians)

      OSI Certified Open Source Software

                 dc@bmath.net
=================================================

            function descriptions

=================================================
            Initialization
            ^^^^^^^^^^^^^^
> bMath      initialization PROC
      invoke      bMath      ; no params, initializes conversion
                  ; factors and tables
----------------------------------------------------------
            Sin/Cos fn's
            ^^^^^^^^^^^^
  note:      if using Bmathecx.inc instead of Bmath.inc, ecx is
      used instead of esi. the same suffixes are used for
      register preservation but refer to the register
      being used.
----------------------------------------------------------
> bSin      Sine for Bittian angles            !! 27 clocks !!
      use instead of fsin, TOS is input and result.
          Variations:
            bSinS - preserve esi (+2 clocks)
            bSinD - preserve edi (+2 clocks)
            bSinB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> bCos      Cosine for Bittian angles      !! 27 clocks !!
      use instead of fcos, TOS is input and result.
          Variations:
            bCosS - preserve esi (+2 clocks)
            bCosD - preserve edi (+2 clocks)
            bCosB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> rSin      Sine for Radian angles            !! 30 clocks !!
      use instead of fsin, TOS is input and result.
          Variations:
            rSinS - preserve esi (+2 clocks)
            rSinD - preserve edi (+2 clocks)
            rSinB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> rCos      Cosine for Radian angles      !! 30 clocks !!
      use instead of fcos, TOS is input and result.
          Variations:
            rCosS - preserve esi (+2 clocks)
            rCosD - preserve edi (+2 clocks)
            rCosB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> dSin      Sine for Degree angles            !! 30 clocks !!
      use instead of fsin, TOS is input and result.
          Variations:
            dSinS - preserve esi (+2 clocks)
            dSinD - preserve edi (+2 clocks)
            dSinB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> dCos      Cosine for Degree angles      !! 30 clocks !!
      use instead of fcos, TOS is input and result.
          Variations:
            dCosS - preserve esi (+2 clocks)
            dCosD - preserve edi (+2 clocks)
            dCosB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> bCS      Cosine and Sine for Bittians      !! 37 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = cos(in)
            ST(1) = sin(in)
          Variations:
            bCSS - preserve esi (+2 clocks)
            bCSD - preserve edi (+2 clocks)
            bCSB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> bSC      Sine and Cosine for Bittians      !! 37 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = sin(in)
            ST(1) = cos(in)
          Variations:
            bSCS - preserve esi (+2 clocks)
            bSCD - preserve edi (+2 clocks)
            bSCB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> rCS      Cosine and Sine for Radians      !! 40 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = cos(in)
            ST(1) = sin(in)
          Variations:
            rCSS - preserve esi (+2 clocks)
            rCSD - preserve edi (+2 clocks)
            rCSB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> rSC      Sine and Cosine for Radians      !! 40 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = sin(in)
            ST(1) = cos(in)
          Variations:
            rSCS - preserve esi (+2 clocks)
            rSCD - preserve edi (+2 clocks)
            rSCB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> dCS      Cosine and Sine for Degrees      !! 40 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = cos(in)
            ST(1) = sin(in)
          Variations:
            dCSS - preserve esi (+2 clocks)
            dCSD - preserve edi (+2 clocks)
            dCSB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> dSC      Sine and Cosine for Degrees      !! 40 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = sin(in)
            ST(1) = cos(in)
          Variations:
            dSCS - preserve esi (+2 clocks)
            dSCD - preserve edi (+2 clocks)
            dSCB - preserve both esi and edi (+4 clocks)
----------------------------------------------------------
> bSnapS      Snap input to nearest Bittian, return sine
                              !! 14 clocks !!
          Adjustment:
            +/- about 1/6 degree
          Variations:
            bSnapSs - preserve esi (+2 clocks)
----------------------------------------------------------
> bSnapC      Snap input to nearest Bittian, return cosine
                              !! 14 clocks !!
          Adjustment:
            +/- about 1/6 degree
          Variations:
            bSnapCs - preserve esi (+2 clocks)
----------------------------------------------------------
> bSnapCS      Snap input to nearest Bittian, return Cosine and
      Sine                        !! 15 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = cos(in)
            ST(1) = sin(in)
          Variations:
            bSnapCSs - preserve esi (+2 clocks)
----------------------------------------------------------
> bSnapSC      Snap input to nearest Bittian, return Sine and
      Cosine                        !! 15 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = sin(in)
            ST(1) = cos(in)
          Variations:
            bSnapSCs - preserve esi (+2 clocks)
----------------------------------------------------------
> rSnapS      Snap input to nearest Bittian, return sine
                              !! 17 clocks !!
          Adjustment:
            +/- about 1/6 degree
          Variations:
            rSnapSs - preserve esi (+2 clocks)
----------------------------------------------------------
> rSnapC      Snap input to nearest Bittian, return cosine
                              !! 17 clocks !!
          Adjustment:
            +/- about 1/6 degree
          Variations:
            rSnapCs - preserve esi (+2 clocks)
----------------------------------------------------------
> rSnapCS      Snap input to nearest Bittian, return Cosine and
      Sine                        !! 18 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = cos(in)
            ST(1) = sin(in)
          Variations:
            rSnapCSs - preserve esi (+2 clocks)
----------------------------------------------------------
> rSnapSC      Snap input to nearest Bittian, return Sine and
      Cosine                        !! 18 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = sin(in)
            ST(1) = cos(in)
          Variations:
            rSnapSCs - preserve esi (+2 clocks)
----------------------------------------------------------
> dSnapS      Snap input to nearest Bittian, return sine
                              !! 17 clocks !!
          Adjustment:
            +/- about 1/6 degree
          Variations:
            dSnapSs - preserve esi (+2 clocks)
----------------------------------------------------------
> dSnapC      Snap input to nearest Bittian, return cosine
                              !! 17 clocks !!
          Adjustment:
            +/- about 1/6 degree
          Variations:
            dSnapCs - preserve esi (+2 clocks)
----------------------------------------------------------
> dSnapCS      Snap input to nearest Bittian, return Cosine and
      Sine                        !! 18 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = cos(in)
            ST(1) = sin(in)
          Variations:
            dSnapCSs - preserve esi (+2 clocks)
----------------------------------------------------------
> dSnapSC      Snap input to nearest Bittian, return Sine and
      Cosine                        !! 18 clocks !!
      use like an FPU instruction, TOS is input, 
          results:
            TOS = sin(in)
            ST(1) = cos(in)
          Variations:
            dSnapSCs - preserve esi (+2 clocks)
----------------------------------------------------------
            Reductions
            ^^^^^^^^^^
    note: BTN is the symbol (and double word variable) I
      use for the 10 bit position discription variable
      (bitmapped sector, quadrant, octant,...) because
      it resembles Bittians. BTN is a 'snapped' reduced
      Bittian angle.
----------------------------------------------------------
> bReduce      simplifies to under 1024 Bittians, result in TOS
      and gives BTN in the variable 'BTN'
                              !! 23 clocks !!
----------------------------------------------------------
> rReduce      simplifies to under 2pi Radians, result in TOS
      and gives BTN in the variable 'BTN'
                              !! 29 clocks !!
----------------------------------------------------------
> dReduce      simplifies to under 360 Degrees, result in TOS
      and gives BTN in the variable 'BTN'
                              !! 29 clocks !!
----------------------------------------------------------
> bBTN      get BTN from Bittian angle      !! 9 clocks !!
    variations:
      bBTNp      same with a pop            (+0 clocks)
      bBTNm      for more accurate results if input may
            be negative (bReduced angles are positive)
                              (+?? clocks)
      bBTNmp      same with a pop            (+?? clocks)
----------------------------------------------------------
> rBTN      get BTN from Radian angle      !! 12 clocks !!
    variation:
      rBTNp      same with a pop
----------------------------------------------------------
> dBTN      get BTN from Degree angle      !! 12 clocks !!
    variation:
      dBTNp      same with a pop
----------------------------------------------------------
> bSqrt      Square Root                     !! 23 clocks !!
----------------------------------------------------------
conversion constants: ( use with fmul !! 3 clocks !! )
~~~~~~~~~~~~~~~~~~~~~
>      D2B - Degrees to Bittians
>      R2B - Radians to Bittians
>      B2D - Bittians to Degrees
>      B2R - Bittians to Radians
>      D2R - Degrees to Radians
>      R2D - Radians to Degrees
