How can I parameterize these angles

26 Views Asked by At

My angle starts at 90, goes down to 0/360, then down to 270. This is a 180 degree range of motion.

How can I express these angles from 0 - 180 instead of 90 - 270, where 90 gives 0 and 270 gives 180.

1

There are 1 best solutions below

0
On BEST ANSWER

Let $\theta$ be the input angle, and $f(\theta)$ be the output angle.

When $\theta = 90^\circ$, $f(\theta) = 0^\circ$. And for each $1^\circ$ drop in $\theta$, $f(\theta)$ increase by $1^\circ$. Hence $f(\theta) = 90^\circ - \theta$ might be a good start.

But, when $\theta = 359^\circ$, the desired output should be $f(\theta) = 91^\circ$ instead of $90^\circ - 359^\circ = -269^\circ$. One easy way to normalise is to use $\arccos$ which has a range of $[0^\circ, 180^\circ]$:

$$f(\theta) = \arccos\left[ \cos\left(90^\circ-\theta\right)\right] = \arccos\left( \sin\theta\right)$$