Java Degree to Radian degToRad(final double deg)

Here you can find the source of degToRad(final double deg)

Description

Converts a value in degree to radians.

License

Open Source License

Parameter

Parameter Description
deg The degree to convert

Return

The given value in radians

Declaration

public static double degToRad(final double deg) 

Method Source Code

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

public class Main {
    /**/*from  w  ww. j av a 2s .com*/
     * The degrees which represents a half circle.
     */
    private static final int HALF_CIRCLE_DEG = 180;

    /**
     * Converts a value in degree to radians.
     * 
     * @param deg
     *            The degree to convert
     * @return The given value in radians
     */
    public static double degToRad(final double deg) {
        return deg * Math.PI / HALF_CIRCLE_DEG;
    }
}

Related

  1. degreesToRadians(float degrees)
  2. degToRad(double angle)
  3. degToRad(double deg)
  4. degToRad(double degrees)
  5. degToRad(Double secondCoordinate, Double firstCoordinate)
  6. degToRad(final float deg)
  7. degToRad(float deg)
  8. toRadians(double angleDegrees)
  9. toRadians(double degrees)