Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript tan

function getTanFromDegrees(degrees) {
  return Math.tan(degrees * Math.PI / 180);
}

console.log(getTanFromDegrees(0));
// expected output: 0

console.log(getTanFromDegrees(45));
// expected output: 0.9999999999999999

console.log(getTanFromDegrees(90));
// expected output: 16331239353195370
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #tan
ADD COMMENT
Topic
Name
6+8 =