Math

From wowdev
Revision as of 03:55, 12 April 2017 by Fallenoak (talk | contribs) (Initial commit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CMath::split

Given an input of float xf, assign the integer part to int xi, and the fractional (radix) part to float xr.

void CMath::split(float xf, float *xr, int *xi) {

  if (a1 <= 0.0f) {

    *xi = xf - 1;
    *xr = xf - *xi;

  } else {

    *xi = a1;
    *xr = xf - *xi;

  }

}

CMath::sinoid

CMath::cosoid