Java Angle angleToCompass(double angleIn)

Here you can find the source of angleToCompass(double angleIn)

Description

angle To Compass

License

Open Source License

Declaration

public static String angleToCompass(double angleIn) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String angleToCompass(double angleIn) {
        double angle = angleIn % 360.0;
        if (angle < 22.5)
            return "N ";
        else if (angle < 67.5)
            return "NE";
        else if (angle < 112.5)
            return "E ";
        else if (angle < 157.5)
            return "SE";
        else if (angle < 202.5)
            return "S ";
        else if (angle < 247.5)
            return "SW";
        else if (angle < 292.5)
            return "W ";
        else if (angle < 337.5)
            return "NW";
        else/*from w  w w  .j a  v a2s .  c  o  m*/
            return "N ";
    }
}

Related

  1. angleOfLineDeg(double x1, double y1, double x2, double y2)
  2. angleRadToDegClipped(final double angleRad)
  3. anglesInvalid(double sza, double vza, double saa, double vaa)
  4. angleSum(float a1, float a2)
  5. angleTo(final int x, final int y, final int thatx, final int thaty)
  6. angleToDefaultAngle(double angle)
  7. angleToFacing(float angle)
  8. angleYawinRange(float start, float end, float angle)