From 6472d690c24c4c347b82063f0549d36652e95ebc Mon Sep 17 00:00:00 2001 From: tenolly Date: Thu, 12 Dec 2024 12:31:12 +0300 Subject: [PATCH 1/3] fix x coord --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0c9916a..a142aa2 100644 --- a/index.js +++ b/index.js @@ -124,7 +124,7 @@ function drawBall() { } function updateStats() { - stats.innerText = `x: ${(canvas.width / window.devicePixelRatio - ball.x).toFixed(1)}\n`+ + stats.innerText = `x: ${ball.x.toFixed(1)}\n`+ `y: ${(canvas.height / window.devicePixelRatio - ball.y).toFixed(1)}\n` + `Угол: ${(ball.angle * 180 / Math.PI).toFixed(0)}\n` + `Скорость: ${ball.velocity.toFixed(2)}` From 9c50c32cb4f5eac149c38c87d8e53bfba58e7904 Mon Sep 17 00:00:00 2001 From: tenolly Date: Thu, 12 Dec 2024 12:33:34 +0300 Subject: [PATCH 2/3] fix coords --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index a142aa2..aa19c3c 100644 --- a/index.js +++ b/index.js @@ -124,8 +124,8 @@ function drawBall() { } function updateStats() { - stats.innerText = `x: ${ball.x.toFixed(1)}\n`+ - `y: ${(canvas.height / window.devicePixelRatio - ball.y).toFixed(1)}\n` + + stats.innerText = `x: ${(ball.x / 3).toFixed(1)}\n`+ + `y: ${((canvas.height / window.devicePixelRatio - ball.y) / 3).toFixed(1)}\n` + `Угол: ${(ball.angle * 180 / Math.PI).toFixed(0)}\n` + `Скорость: ${ball.velocity.toFixed(2)}` } @@ -171,6 +171,7 @@ function animateBall() { })); const url = `https://physics.zzvt.pw/api/interpolation?h=${height}&l=${length}&g=${g}&alpha=${angle}&count=1000`; + console.log(length) xhr.open("GET", url, true); console.log(`Sent request to ${url}`) From 1305a76c853d5b98ae656253a322b5b1c56f5a0f Mon Sep 17 00:00:00 2001 From: tenolly Date: Thu, 12 Dec 2024 12:35:37 +0300 Subject: [PATCH 3/3] revert --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index aa19c3c..77f0b49 100644 --- a/index.js +++ b/index.js @@ -124,8 +124,8 @@ function drawBall() { } function updateStats() { - stats.innerText = `x: ${(ball.x / 3).toFixed(1)}\n`+ - `y: ${((canvas.height / window.devicePixelRatio - ball.y) / 3).toFixed(1)}\n` + + stats.innerText = `x: ${ball.x.toFixed(1)}\n`+ + `y: ${(canvas.height / window.devicePixelRatio - ball.y).toFixed(1)}\n` + `Угол: ${(ball.angle * 180 / Math.PI).toFixed(0)}\n` + `Скорость: ${ball.velocity.toFixed(2)}` }