/
Charlz_Klug
/
EloquentJavaScript
Обзор
Документация
Войти
/
Charlz_Klug
/
EloquentJavaScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
04_Data_Structures/072_Math/math.html
22 строки
471 B
Imil Ametov
Chapter 04. The Math Object.
03 апр 2026, 17:08
03 апр 2026, 17:08
f215edf
Код
Авторство
О чём код?
<!DOCTYPE html> <html> <body> <h2>JavaScript. Methods.</h2> <p id="demo"></p> <script> function randomPointOnCircle(radius) { let angle = Math.random() * 2 * Math.PI; return {x: radius * Math.cos(angle), y: radius * Math.sin(angle)}; } console.log(randomPointOnCircle(2)); console.log(Math.random()); console.log(Math.random()); console.log(Math.random()); console.log(Math.floor(Math.random() * 10)); </script> </body> </html>