Between -180 and 180 degrees (convert a larger angle)

  • Context: Undergrad 
  • Thread starter Thread starter Philosophaie
  • Start date Start date
  • Tags Tags
    Angle Degrees
Click For Summary

Discussion Overview

The discussion revolves around finding a formula to convert an angle into the range of -180 to 180 degrees, with participants exploring methods to achieve this transformation. The context includes mathematical reasoning and technical explanations related to angle conversion.

Discussion Character

  • Mathematical reasoning, Technical explanation

Main Points Raised

  • One participant proposes a formula for converting angles to the range of -180 to 180 degrees, referencing their success with a formula for the range of 0 to 360 degrees.
  • Another participant suggests subtracting 180 from the angle as a potential solution, though they express uncertainty about the original request.
  • A third participant reiterates the need for a formula to convert angles to the specified range and identifies the function as modulo (mod) 360.
  • A later reply suggests adding π to the original formula to achieve the desired interval, explaining that the interval [-180, 180] is a translation of [0, 360] by -π.

Areas of Agreement / Disagreement

Participants present multiple approaches to the problem, with no consensus on a single solution or method. The discussion remains unresolved regarding the best formula to use.

Contextual Notes

There are limitations in the assumptions made about angle representation and the definitions of the functions discussed. The mathematical steps involved in the proposed solutions are not fully resolved.

Philosophaie
Messages
456
Reaction score
0
I need a formula to put an angle between -180 and 180 and recycle if not in the range.

I can do it between 0 and 360:

angle = deg - 360 * floor(deg / 360)

just not between -180 and 180

Oh and what is the name of this function?
 
Mathematics news on Phys.org
Take what you have and subtract 180.

Unless I'm not understanding what you're asking.
 
Philosophaie said:
I need a formula to put an angle between -180 and 180 and recycle if not in the range.

I can do it between 0 and 360:

angle = deg - 360 * floor(deg / 360)

just not between -180 and 180

Oh and what is the name of this function?
Function is modulo (mod). What you are asking for is mod 360.
 
EDIT Just add ## \pi ## to your formula and you will hit an angle in that interval. The interval [-180,180] is the translation of [0,360] by ##- \pi ##
 
Last edited:

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 21 ·
Replies
21
Views
5K
  • · Replies 3 ·
Replies
3
Views
1K