Title: Angle of 2D vertex
Function VertexAngle(x1,y1,x2,y2,x3,y3:Double):Double;
Var Dist : Double;
Begin
(* Quantify coordinates *)
x1 := x1 - x2;
x3 := x3 - x2;
y1 := y1 - y2;
y3 := y3 - y2;
(* Calculate Lay Distance *)
Dist := (x1*x1+y1*y1)*(x3*x3+y3*y3);
If Dist=0 Then Result := 0.0
Else
Result := ArcCos((x1*x3+y1*y3)/sqrt(Dist))*_180DivPI;
End;
(* End Of VertexAngle *)