public static DirectionData createFor(final float direction, final DeviceOrientation dp, final float[] orientationVector, final boolean inputInRadian) {
        final boolean vecIsNull = orientationVector == null;
        return new DirectionData(
                inputInRadian ? radianToDegree(direction) : direction,
                dp,
                vecIsNull ? null : (inputInRadian ? radianToDegree(orientationVector[0]) : orientationVector[0]),
                vecIsNull ? null : (inputInRadian ? radianToDegree(orientationVector[1]) : orientationVector[1]),
                vecIsNull ? null : (inputInRadian ? radianToDegree(orientationVector[2]) : orientationVector[2])
        );
    }
Create from orientation vector as returned by {@link SensorManager#getOrientation(float[], float[])}
main/src/main/java/cgeo/geocaching/sensors/DirectionData.java