Use the trig functions in java.lang.Math . Like java.lang.Math.random( ) , all themethods of the Math class are static, so no Math instance is necessary. This makessense, as none of these computations maintains any state. Note that the argumentsfor trigonometric functions are in radians, not in degrees. Here is a program thatcomputes a few (mostly) trigonometric values and displays the values of e and PI thatare available in the math library: