From eb0d87a90634a4e6c3125bcb8dc2d03875694652 Mon Sep 17 00:00:00 2001 From: Yashwanth G Date: Fri, 13 Feb 2026 10:26:53 +0530 Subject: [PATCH] Refactor angle function to eyeAngle --- Eyes Moving/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Eyes Moving/index.js b/Eyes Moving/index.js index 608d5208..c0fe5d75 100644 --- a/Eyes Moving/index.js +++ b/Eyes Moving/index.js @@ -13,7 +13,7 @@ document.addEventListener('mousemove', (e)=>{ - const angleDeg = angle(mouseX, mouseY, anchorX, anchorY); + const angleDeg = eyeAngle(mouseX, mouseY, anchorX, anchorY); // console.log(angleDeg); @@ -23,11 +23,12 @@ document.addEventListener('mousemove', (e)=>{ }) -function angle(cx,cy,ex,ey) { +function eyeAngle(cx,cy,ex,ey) { const dy = ey - cy; const dx = ex - cx; const rad = Math.atan2(dy, dx) // Range const deg = rad * 180 / Math.PI; return deg; -} \ No newline at end of file + +}