Math.tan()

Math.tan() returns the trigonometric tan value of an angle in radian.
Syntax
Math.tan(angle_in_radian)
Note that all input numbers are in Radians.

Here are some examples.
System.out.println(Math.tan(Math.PI));	//-1.2246467991473532E-16
System.out.println(Math.tan(Math.PI/2));//1.633123935319537E16
System.out.println(Math.tan(2)); 	//-2.185039863261519
System.out.println(Math.tan(1.22));	//2.7327541993067146
System.out.println(Math.tan(-1.22)); 	//-2.7327541993067146
System.out.println(Math.tan(0));	// 0.0
We can use toRadians to convert degree value to radian.
Math.round() to rounds a floot or double data type to nearest integer value
System.out.println(Math.round((Math.tan(Math.toRadians(180)))));//0
System.out.println((Math.tan(Math.toRadians(180))));//1.2246467991473532E-16
System.out.println(Math.tan(Math.toRadians(90))); //1.633123935319537E16
System.out.println(Math.tan(Math.PI)); 		//-1.2246467991473532E-16
System.out.println(Math.tan(Math.PI/2));	//1.633123935319537E16


All Math functions

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer