Calculate radian from degree - Java java.lang

Java examples for java.lang:Math Radian

Description

Calculate radian from degree

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        double degrees = 2.45678;
        System.out.println(radFromDeg(degrees));
    }/*from  w w  w . j  ava 2  s .c o  m*/

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

Related Tutorials