# Sine Waves for Fun and Profit

I’ve been playing with a few watchface ideas and thought I’d share some samples using the sin function (first off - there’s a sin and cos function!)

I wanted to do a conceptual watch with the eye slowly opening and then closing through the 24 hours of the day (so it starts closed at midnight, and opens fully by noon, then closes again by midnight.

This is the 24 hour cycle:

To get this effect, I need a sin function that would complete one phase in 24 hours. I guessed my way through the math But I hope my guesstimates help someone else in their idea!

I used this sin formula for the eyelid Y value:

``````((sin(#DWFHS#/104)*-200)-35)
``````

And this one for the iris Y value:

``````(-(sin(#DWFHS#/104)*40)+200)
``````

And this one for the pupil Y value:

``````(-(sin(#DWFHS#/104)*40)+200)
``````

And finally this one for the transparency of the ‘bloodshot’ veins that start to fade in when it gets tired:

``````(100-(sin(#DWFHS#/104)*50)-50)
``````

(notice how hacky it is!)