## Function `phase( t, period, t0, phase0 )`

Description:
  Returns the offset phase of an offset value within a period. The reference value `t0` corresponds to integer phase value, and the phase offset `phase0` determines the starting value for the phase range.

  For positive period, the returned value is in the range [`phase0`,`phase0+1`).

Parameters:
  `t` (floating point)
    value
  `period` (floating point)
    folding period
  `t0` (floating point)
    reference value, corresponding to phase zero
  `phase0` (floating point)
    offset for phase

Return Value (floating point):
  offset phase

Examples:
  - `phase(23,10,1,99) = 99.2`
  - `phase(8.6125,0.2,0.0125,-0.3) = 0`
  - `phase(8.6125,0.2,0.1125,-0.7) = -0.5`

Signature:
  `double phase(double, double, double, double)`