calculate degree from radian - Java java.lang

Java examples for java.lang:Math Radian

Description

calculate degree from radian

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        double radian = 2.45678;
        System.out.println(degFromRad(radian));
    }//  www.j a v a  2 s. co m

    /**
     * calculate degree from radian
     * @param radian
     * @return degree
     */
    public static double degFromRad(double radian) {
        return radian * 180 / Math.PI;
    }
}

Related Tutorials