# Get value of angle with 45 degrees as maximum and 0 and 90 degrees as minimum

I want the calculate the "value" of an angle in such a way that:

• The angle of 45 degrees corresponds with the maximum value of 1
• The angles of 0 and 90 degrees correspond with the minimum value of 0
• All angles between should be relative to these maximum and minimum values

I figured I should do some calculations with sin/cos and shift their period, but I can't reconstruct how to do this.

Kind regards,

-
The sine of twice the angle. –  Did Apr 16 '12 at 10:12
Yes, I think that will do it. Thank you. –  Flaxfield Apr 16 '12 at 10:16
As @Didier says, $\sin 2\theta$ works for you on $[0,90^\circ]$. It has period $180^\circ$, has linear roots (crosses the $x$-axis) at $0$ & $90^\circ$, and is always in $[-1,1]$. If you want a periodic function that's always in $[0,1]$, you can square this to get $\sin^22\theta$, which by a trig identity is equivalent to $\frac{1-\cos 4\theta}{2}$, from which one can see that it has period $90^\circ$ and has a sharper curve at the maximum and the same curve at the minimum. –  bgins Apr 16 '12 at 10:23