sine analog compare triangle signal to pwm

try the Map function
http://www.arduino.cc/en/Reference/Map