<-- Previous || Up || Next -->

Sawtooth Wave Function
Math Arithmetic Class

Public Function SawtoothWave( _
      ByVal vNumber As Variant _
    , ByVal vCycle As Variant _
    ) As Variant

Function whose plotted output resembles the teeth of a saw.
Note that this function is offset from the origin.

Plots:
    Cycle = 6:
         *  |  *     *
    *   * * | * *   * *   *
     * *   *|*   * *   * *
    --*-----*-----*-----*--
            |
    Cycle = -6:
            |
    --*-----*-----*-----*--
     * *   *|*   * *   * *
    *   * * | * *   * *   *
         *  |  *     *

Examples:
    SawtoothWave(-1, 6) = 1
    SawtoothWave(0, 6) = 0
    SawtoothWave(1, 6) = 1
    SawtoothWave(2, 6) = 2
    SawtoothWave(3, 6) = 3
    SawtoothWave(4, 6) = 2
    SawtoothWave(5, 6) = 1
    SawtoothWave(6, 6) = 0
    SawtoothWave(7, 6) = 1
See also:
    SawtoothWaveSample Subroutine
    SquareWave Function
    Sine Function
    Cosine Function
vNumber: The X position of the sawtooth wave whose Y position will be returned. Function returns Null if vNumber is Null or cannot be fixed up to a number.

vCycle: The wavelength of the sawtooth wave; the length of one cycle. Function returns Null if vCycle is Null or cannot be fixed up to a number.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.