Function babalcore::sine_wave[][src]

pub fn sine_wave(x: f64) -> f64

Sine wave func as defined here: https://en.wikipedia.org/wiki/Sine_wave It's a simple sinusoid, only this one has a period of 1 instead of 2PI. The idea is to be able to use it as a drop in for triangle_wave for instance, without introducing a 2*PI factor. If you want a real sin, just use the builtin func.

use babalcore::*;

assert_eq!(-1.0, sine_wave(-0.25));
assert_eq!(0.0, sine_wave(0.0));
assert_eq!(1.0, sine_wave(0.25));