Zcd(500Hz) Sin(50Hz) change output Zcd to 50Hz

http://playground.arduino.cc/Main/ACPhaseControl

This link says about phase control ... this is very close to the result I need BUT....

The trigger i need varies with the temperature ->duty cycle

that is the t1(in fig) depends on the duty cycle which is achieved by the varying temperature which is in the t3 range.

Can any one suggest a variation in the code from the link. Assuming that there exists a function temp() which returns a value that is the duty cycle.

please reply