Java examples for 2D Graphics:Color
Computes cosine for some angle represented in degrees [0, 360].
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { double deg = 2.45678; System.out.println(cos(deg)); }//from ww w. jav a 2 s . co m /** * Computes cosine for some angle represented in degrees [0, 360]. * @param deg An angle in degrees. * @return */ public static final double cos(double deg) { return Math.cos(Math.toRadians(deg)); } }