Help : need to convert rotation in radians to "8" directions

but here is the kicker… it is NOT a simple convert radians to nearest multple of 45 degrees.

I have a control that has 8 allowed directions (corresponding to compass points)

If I do a touch gesture on an iPhone, it returns delta radians as I rotate my two fingers.
I need to figure out somehow when during that event to issue a +1 or -1 to the control

The gesture turns in fractional degrees but the control needs to “click” at the right time.

One idea (which I havent tested yet) is to do nothing until the gesture delta is exactly 45 degrees either direction. then tell the control to move 1 compass point … and reset the gesture delta to zero.

any other ideas?

It may be just me not understanding but I don’t know what you want to do.

I get what you don’t want to do,

But I don’t know what your question is here:

Are you asking how to make the transition feel right?

Why not program it to change only when the new position is “close” to the next one, as defined by a certain angle difference, and try how it feels varying that angle?

What I mean is that the control would switch to the new position when delta is above a certain threshold (below 45) that you can set to check how the control responds for different values of that threshold.

yes, you did understand :slight_smile:

But for now I’ve decided the leave this out of the app… it isn’t natural to turn a gesture 360deg. you’d break your wrist… and doing it in increments took longer than tapping a designated “button”

When the user rotate to 15° or more, set the rotation to the next value 45°.
Once implemented, you will be able to decide if 15° is enough (I think so. 15° is a good value to avoid an user error and help the user to rotate).

it isn’t natural… Button
iPhone is more finger move than finger tap (IMHO, but I have none, so I may be wrong), so a single movement; and the movement can be done in anti-clock rotation, so only 180°… ;-:slight_smile: