Python Practice › NumPy Programs › Program 95

Tangent of angles

EasyNumPy Programs · 95 of 100

Write a NumPy program to calculate the tangent of angles.

Advertisement
Input
0, 45 degrees
Output
[0. 1.]

Approach

  1. np.tan(np.radians(...)).

Solution

Python
import numpy as npprint(np.tan(np.radians([0, 45])).round(3))
Output
[0. 1.]

Learn the concept

New to this topic? Read the lesson, then come back.

More numpy programs

← All 100 NumPy Programs

Leave a Comment