15
$\begingroup$

I searched but couldn't find on Google:

My question is, how do I find the opposite direction of an angle, for example 170 degree, how do I calculate the opposite direction in degrees?

Thanks in advance.

$\endgroup$
3
  • 2
    $\begingroup$ What do you call opposite direction??? It is not clear. $\endgroup$
    – Martigan
    Commented Jun 10, 2015 at 7:25
  • $\begingroup$ for example if north is 0 degrees, the opposite would be 180 degrees, I know this looking at a protractor, but I want to be able to calculate the opposite of any degrees. $\endgroup$ Commented Jun 10, 2015 at 7:27
  • 1
    $\begingroup$ The so-called "opposite direction angles" form a straight line. And as the angle of a straight line is 180 degree, you can just add 180 degree to the known "opposite direction angle" to find out the other. $\endgroup$ Commented Jun 10, 2015 at 7:32

3 Answers 3

15
$\begingroup$

If you are given an angle $\alpha$, the oppossite angle would be $\alpha+180$. If you need to remain in $[0,360]$ then, you should take $(\alpha+180)\ mod\ 360$ (what in this case it is simply taking $\alpha-180$ if $\alpha+180\ge360$)

$\endgroup$
2
  • $\begingroup$ I'm using c programming language for this, I don't know how the angle function works so will have to create the condition you provided, thanks for the answer. $\endgroup$ Commented Jun 10, 2015 at 10:46
  • 3
    $\begingroup$ Try (alpha+180)%360. $\endgroup$
    – AugSB
    Commented Jun 10, 2015 at 11:03
2
$\begingroup$

In aviation the 200/20 rule can be used. If your current heading in degree is below 180° e.g. 80° then you add 200 and subtract 20. 80+200=280. 280-20=260. If your current heading in degrees is above 180° then subtract 200 and add 20. E.g. 240-200=40. 40+20=60

$\endgroup$
-1
$\begingroup$

Considering an angle normallized between -180° and 180°, the opposite angle is given by :

if angle == 0 :
  opposite = 180 // or -180 as you wish
else :
  if angle > 0 :
    opposite = angle - 180
  else :
    opposite = angle + 180
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .