- #1

- 461

- 0

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?

- Thread starter Philosophaie
- Start date

- #1

- 461

- 0

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?

- #2

- 941

- 394

Take what you have and subtract 180.

Unless I'm not understanding what you're asking.

Unless I'm not understanding what you're asking.

- #3

mathman

Science Advisor

- 7,859

- 447

Function is modulo (mod). What you are asking for is mod 360.

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?

- #4

WWGD

Science Advisor

Gold Member

2019 Award

- 5,341

- 3,295

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:

- Replies
- 14

- Views
- 4K

- Last Post

- Replies
- 7

- Views
- 16K

- Replies
- 4

- Views
- 8K

- Last Post

- Replies
- 11

- Views
- 2K

- Last Post

- Replies
- 1

- Views
- 1K

- Last Post

- Replies
- 2

- Views
- 2K

- Last Post

- Replies
- 13

- Views
- 4K

- Last Post

- Replies
- 2

- Views
- 1K

- Replies
- 3

- Views
- 887

- Last Post

- Replies
- 1

- Views
- 681