I need to create a sine wave function through the PWM pins where the sine wave is pointy at the crests and 2 times wide at the bottom. I'm guessing a function which emulates the full rectification of a sine wave would be the way to go. Here is some of the current code I am using:

void loop() {

float a = 128.0;

float b = 128.0;

float c = 28000.0;

float d = 2.0;

float e = 18.3; //offset

{

int value = a + b * sin((millis()/c) * d * PI );

analogWrite(2,value);

}