JS Built-ins
← Math39 / 215
MathSQRT2intermediate

Math.SQRT2 β€” use in diagonal calculation

πŸ“– Usage Example
// Square root of 2
Math.SQRT2              // β†’ 1.4142135623...
Math.SQRT2 === Math.sqrt(2)   // β†’ true

Use Math.SQRT2 as a precomputed constant equal to √2, useful in geometry and diagonal calculations.

Math.SQRT2

The diagonal of a square with side length s is s√2. For a unit square, diagonal = √2.

Challenge: Use Math.SQRT2 to compute diagonals of squares.

πŸ’‘ Hints (2)
  • β€’ Diagonal of a square = side * √2
  • β€’ Math.sqrt(18) = 3√2 because √18 = √(9Γ—2) = 3√2.