JS Built-ins
← Math205 / 215
Mathtanadvanced

Math.tan() β€” tan(Ο€) β‰ˆ 0

πŸ“– Usage Example
// Tangent of an angle in radians
Math.tan(0)            // β†’ 0
Math.tan(Math.PI / 4)  // β†’ 1

Use Math.tan() to compute the tangent of an angle in radians for trigonometry and slope calculations.

Math.tan()

Returns the tangent of a number (in radians).

Challenge: Observe that Math.tan(Math.PI) returns a value very close to 0 (floating-point approximation).

πŸ’‘ Hints (1)
  • β€’ tan(Ο€) = 0 mathematically; floating-point gives a tiny near-zero value due to Ο€ approximation