I am trying to find a function for the following scenario:

Rotating the red arrow will produce a nice sine wave as illustrated to the right of the hexagon. But I need to rotate the blue arrow, and at the same time limit the magnitude according to the hexagon. That means that the magnitude will be 1 at every 60 degrees, and decrease to 0.866 at 60+30 degrees before increasing back to 1.
Something like this:

Lastly, i am going to use this varying value in a new sine wave function. That function will look like the dotted curve in the picture below:

But I cannot find the actual function to produce such a curve. (I need it to make a figure about six step operation in electric motor drives)
Hope you can help me
