How to calculate the angle between the straight lines formed by three lines

in the Cartesian coordinate system, how to calculate the rotation angle of two lines connected by two points and 0 in Cartesian coordinate system, that is, how to realize this method

, it returns a negative number counterclockwise, that is,-180 degrees
how to realize this method

getAngle (x1, y1, x2, y2, x3, y3) {
  
}

getAngle(0,0,0,-1,0,1)
//  -180

getAngle(0,0,0,-1,-1,-1)
//  45
Feb.28,2021

$$ Arccos (\ frac {(x_2-x_1) * (x_3-x_1) + (y_2-y_1) * (y_3-y_1)} {\ sqrt {(x_2-x_1) ^ 2 + (y_2-y_1) ^ 2} *\ sqrt {(x_3-x_1) ^ 2 + (y_3-y_1) ^ 2}}) $


now that you know the coordinates of the two points,

 
  yes=>180
  no=>
      => 
      

Menu