const degree = radians * (180 / Math.PI) * -1 + **90**; Change this line to const degree = radians * (180 / Math.PI) + 180 // You can handle the negative sign according to your required direction.