{"id":16138,"date":"2021-08-12T09:36:44","date_gmt":"2021-08-12T04:06:44","guid":{"rendered":"https:\/\/python-programs.com\/?p=16138"},"modified":"2021-11-22T18:38:27","modified_gmt":"2021-11-22T13:08:27","slug":"python-program-to-get-tangent-value-using-math-tan","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-get-tangent-value-using-math-tan\/","title":{"rendered":"Python Program to Get Tangent value Using math.tan()"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Reverse each Word in a Sentence<\/a>
\nMath Module :<\/strong><\/p>\n

Python’s math module is a built-in module. By importing this module, we can perform mathematical computations.<\/p>\n

Numerous mathematical operations like ceil( ),floor( ),factorial( ),mod( ),value of pi ,…..etc .can be computed with the help of math module.<\/p>\n

math.tan() Function in Python:<\/strong><\/p>\n

Using this function, we can quickly find the tangent value for a given angle.<\/p>\n

Tan is a trigonometric function that represents the Tangent function.
\nIts value can be calculated by dividing the length of the opposite side by the length of the adjacent side of a right-angled triangle, as we learned in math.<\/p>\n

By importing the math module that contains the definition, we will be able to use the tan() function in Python to obtain the tangent value for any given angle.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given lower limit range =0\r\nGiven upper limit range =181\r\nGiven step size =30<\/pre>\n

Output:<\/strong><\/p>\n

The Tangent values in a given range are tan( 0 ) =  0.0\r\nThe Tangent values in a given range are tan( 30 ) =  0.5773502691896257\r\nThe Tangent values in a given range are tan( 60 ) =  1.7320508075688767\r\nThe Tangent values in a given range are tan( 90 ) =  1.633123935319537e+16\r\nThe Tangent values in a given range are tan( 120 ) =  -1.7320508075688783\r\nThe Tangent values in a given range are tan( 150 ) =  -0.5773502691896257\r\nThe Tangent values in a given range are tan( 180 ) =  -1.2246467991473532e-16<\/pre>\n

Example 2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given lower limit range = 40\r\nGiven upper limit range = 300\r\nGiven step size = 45<\/pre>\n

Output:<\/strong><\/p>\n

The Tangent values in a given range are tan( 40 ) =  0.8390996311772799\r\nThe Tangent values in a given range are tan( 85 ) =  11.430052302761348\r\nThe Tangent values in a given range are tan( 130 ) =  -1.19175359259421\r\nThe Tangent values in a given range are tan( 175 ) =  -0.08748866352592402\r\nThe Tangent values in a given range are tan( 220 ) =  0.8390996311772799\r\nThe Tangent values in a given range are tan( 265 ) =  11.430052302761332<\/pre>\n

Program to Get Tangent value using math.tan()<\/h2>\n

Below are the ways to Get Tangent value.<\/p>\n