Approximated triangle wave is generated based on the mathematical principle of being equal to a sine wave at the same frequency (50Hz) and infinite alternating sum and subtract of odd-multiple frequency sine waves with diminishing amplitude.
triangle wave = (8/pi^2)*(1V)*(sine at 50Hz) -
(8/pi^2)*(1/9V)*(sine at 150Hz) +
(8/pi^2)*(1/25V)*(sine at 250Hz) -
(8/pi^2)*(1/49V)*(sine at 350Hz) +
(8/pi^2)*(1/81V)*(sine at 450Hz) - ...