0

What is a generic formula for converting azimuth(from -180 to 180) to degrees(from 0 to 360)?

double azimuth = (Math.toDegrees(matrixValues[0]));
           if(azimuth < 0){
               azimuth += 360;
           }
           azimuth -= 90;
           if(azimuth < 0){
               azimuth += 360;
           }

That's what I have tried but it doesn't seemed to work.

zbz.lvlv
  • 3,597
  • 6
  • 34
  • 38
  • This question appears to be off-topic because it is actually about basic mathematics. I believe it belongs on http://math.stackexchange.com/ (Mathematics) instead. – mctylr Jul 21 '14 at 15:02

1 Answers1

1

There are several conventions for azimuths ("geological", "geohraphical" - clockwise, anticlockwise). What´s wrong with double azimuth = (Math.toDegrees(matrixValues[0])) + 180.0; ? Seems to do what you request.

Jakub
  • 583
  • 3
  • 8