Interpolating radial angles?

If I am given a start angle of 1.0f and an end angle of 6.0f, then what I really want to interpolate is not 5 between 1 and 6, but the smaller part. This will cause interpolation counterclockwise. How can I explain this with interpolation?

In fact, for a given 2 radial angles from 0 to 6.283, how can I find out if I should interpolate clockwise or counterclockwise, on the basis of which it would be "shorter"?

thank

+3
source share
3 answers

Get the target angle minus the starting angle. If it is larger than PI, go counterclockwise.

Invert the logic if the value is negative.

+7
source

The reciprocal of any angle? & thetas; - & pi ;.

, & theta;, and & theta; - & pi;, , ?

: , -, .

0

To provide a software solution to this math problem:

Direction WhichDirection(double start, double finish) {
    return ( std::fmod( (finish - start +2*PI), 2*PI) > PI) ? COUNTER : CLOCK;
}
0
source

All Articles