is Ordinal angle - Java 2D Graphics

Java examples for 2D Graphics:Angle

Description

is Ordinal angle

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        float angle = 2.45678f;
        System.out.println(isOrdinal(angle));
    }/*from w w  w  . ja v  a  2s .  c  om*/

    public static boolean isOrdinal(float angle) {
        // Round the angle
        int ordinalAngle = (int) angle;
        if ((ordinalAngle % 90) == 0)
            return true;
        else
            return false;
    }
}

Related Tutorials