Calculate the tan angle of an array using NumPy

In this python numpy program, we will calculate the tan angle of an array using NumPy.

Steps to solve the program
  1. Import the numpy library as np.
  2. Create an array using np.array().
  3. Calculate the tan angle of the array using np.tan().
  4. Print the output.
				
					import numpy as np
angle = np.array([45,13])

print(f"Tan of {angle}: ",np.tan(angle))
				
			

Output :

				
					Tan of [45 13]:  [1.61977519 0.46302113]
				
			

calculate the cos angle of an array.

round off the elements in an array up to two digits.

Leave a Comment