JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="display">
<div id="c"></div>
<div id="b"></div>
CSS
#c {
position: absolute;
top: 190px; left: 190px;
width: 20px; height: 20px;
border-radius: 50%;
background: red;
}
#b {
position: absolute;
top: 10px; left: 190px;
width: 20px; height: 20px;
border-radius: 50%;
background: blue;
}
JavaScript
document.onmousemove = function(evt){
let P1 = {x: 200, y: 200}
let P2 = {x: 200, y: 0}
let P3 = {x: evt.clientX, y: evt.clientY}
let rad = Math.atan2(P3.y - P1.y, P3.x - P1.x) -
Math.atan2(P2.y - P1.y, P2.x - P1.x)
display.value = rad * (180 / Math.PI)
}