SOURCE

const p3 = {x:0, y:0}
const p2 = {x:10, y:0}
const p1 = {x:0, y:-10}


const getAngle = (p1, p2) => {
    const dot = p1.x * p2.x + p1.y * p2.y
    const det = p1.x * p2.y - p1.y * p2.x
    const angle = Math.atan2(det, dot) / Math.PI * 180
    return Math.round(angle + 360) % 360
}
const angle = getAngle({
    x: p1.x - p3.x,
    y: p1.y - p3.y
}, {
    x: p2.x - p3.x,
    y: p2.y - p3.y
});
console.log(angle);
console 命令行工具 X clear

                    
>
console