Arc Tangent in JavaScript

Level 126 keystrokes

Math.atan(1) returns the angle whose tangent is 1, π/4 radians, and prints 0.7853981633974483.

JavaScript code

// Math.atan() is the inverse of tangent: it returns the angle in radians
// tan(π/4) = 1 (a 45° angle), so Math.atan(1) is π/4 ≈ 0.7854
1console.log(Math.atan(1));

Output

0.7853981633974483
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this JavaScript code and how often they appear.

  • .× 2
  • (× 2
  • )× 2
  • ;× 1

More JavaScript examples at level 1

← JavaScript typing practice