Implementation of basic 2-pole low-pass filter
First of all, your filter is a non-typical lowpass filter. The transfer function of your filter is 

$H(z) = \frac{\beta^2}{1+(\beta^2-2\alpha)z^{-1}+\alpha^2z^{-2}}$

where $\alpha = 1-rc$, $\beta=c$. 

In the example you use these values

$c = 2\sin(8000\pi/44100)$, $r = 8^{-0.5}$.

They give the following frequency response. 



In the example where you step-by-step process the first samples of your triangular waveform it seems that you expect that input to pass through undistorted. Is that correct? if so, why do you expect this?

As an alternative you can use a 2nd order butterworth low-pass filter. Here http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt you find the expressions for the coefficients as well as the difference equation you have to implement.