infinite Knob and limited knob

Hello, i’ve made a knob with ofVertex and sin, cos (theta), the .angle or angleRad function and the ofMap (myvalue,-180,180,0.,1.) and it’s working fine. My choosed output value is 0., 1. and then my knob go in this range forever.

What I want :

  1. To make a shaft encoder (infinite) using +1 for clockwise and -1 if not.

  2. To make an other knob that stop at 1. an stop at 0. then don’t turn forever.

Any idea?

No problem with drawing but problem in math.

Thank’s.