Question

I am having trouble finding out how to form a triangle (not sawtooth) wave from a sine wave.

I understand how to create it for a Square wave:

if( sineValue >= 0 )
        value = amp;
    else
        value = -amp;

But I am not sure how to change this to accommodate for a triangle wave.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top