Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6594675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:50:28+00:00 2026-05-25T17:50:28+00:00

Right now ‘m using linear bezier to interpolate angles: float CardAnimation::valueAt( float valueA, float

  • 0

Right now ‘m using linear bezier to interpolate angles:

    float CardAnimation::valueAt( float valueA, float valueB, float t ) const
    {
        return (1.0f - t) * valueA + t * valueB;
    }

....
if(m_startCard.m_angle != m_endCard.m_angle)
            {
                m_targetCard->m_angle = 
                    valueAt(m_startCard.m_angle, m_endCard.m_angle,m_interval);
            }

This works as expected. But here is my problem. If your start angle is 0.5f and you want to go to 6.0f (in radians) then it will go clockwise from 0.5f to 6.0f when really since 6.0f – 0.5f > 3.14f it would be much smarter to go counter clockwise from 0.5f to 6.0f (resulting in moving only 0.78 radians rather than 5.5). What should I do to interpolate counter clockwise if abs(endAngle – startAngle > PI) ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:50:29+00:00Added an answer on May 25, 2026 at 5:50 pm

    If abs(endAngle - startAngle) > PI, then subtract 2*PI from endAngle. Then instead of going from 0.5 to 6.0, you go from 0.5 to -0.28.

    Edit:

    This actually assumes 0 <= startAngle < endAngle <= 2*Pi.

    If 0 <= endAngle < startAngle <= 2*Pi and startAngle - endAngle > PI, then add 2*PI to endAngle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I am using this code to download files (with a Range header).
Right now I'm using Controller_Template would like to have RESTful URLs though, is it
Right now I've been using GDB to disassemble a binary file and check out
Right now I am using learning to program for the iphone and I am
Right now I'm selecting 3 random rows from a table using ORDER BY Rand();
right now I'm creating an array and using: render :json => @comments This would
Right now I'm stuck between using PHP's native session management, or creating my own
Right now I am writing a little c++ console program using VS2010 Express. The
Right now I'm working on a dataset where I would like to return records
Right now to populate my GridViews I'm using a extended BaseAdapter class on each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.