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

  • Home
  • SEARCH
  • 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 9185947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:24:07+00:00 2026-06-17T19:24:07+00:00

Atan2(y,x) will return a float between -pi and pi. I want to calculate the

  • 0

Atan2(y,x) will return a float between -pi and pi. I want to calculate the distance between two angles, but the non-continuity is throwing me off.

See this for better understanding.

I want to be able to calculate the distance between Angle 1 and Angle 2.

The whole point of this is to be able to create a cone from the center to a specified angle. Essentially I will be evaluating:

if(DistanceFromAngle1 < pi/4 [45°])
{
  Angle2 is part of cone
}
  • 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-06-17T19:24:08+00:00Added an answer on June 17, 2026 at 7:24 pm

    If by distance you mean the straight line joining the two interception points, you can calculate the distance by doing this:

    SQRT( ( ABS|cos(A) - cos(B)| )^2 + ( ABS|sin(A) - sin(B)| )^2 )
    

    SQRT = square root

    ABS = Absolute value

    If the distance is the angle, you calculate it by doing (pseudo-code)

    var angle = ABS(A - B)
    if(angle > pi) angle = 2*pi - angle
    return angle
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to calculate the average of a set of angles, which represents source
I'd like to calculate atan2 in VBA, but I'm not sure if that function
I am using float theAngle = atan2( location.y-self.center.y, location.x-self.center.x ); to rotate a wheel
I have two points, a and b . I need to calculate the angle
I'm trying to rotate a model by (float) Math.atan2(-camX.getXf() * padX, -camDir.getZf() * padY)
Possible Duplicate: what is the difference between atan and atan2 in c++ ? Why
I have a polygon that I want to rotate around over 360 degrees but
I want to draw two lines that go through three points, and make a
I am trying the atan2 Math Function but i am getting wrong value in
Same question as last time but I will provide more detail. I am currently

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.