The Math tan() static method returns the tangent of a number in radians.
function getTanFromDegrees(degrees) {
return Math.tan((degrees * Math.PI) / 180);
}
console.log(getTanFromDegrees(0));
// 0
console.log(getTanFromDegrees(45));
// 0.9999999999999999
console.log(getTanFromDegrees(90));
// 16331239353195370