How to determine angle of polyline segment in C#

Hi,

how can I determine the angle to the baseline (see picture) of a polyline segment in C#?.



Thank you for your help!

Comments

  • Dont know C# but in lisp its just a simple case of (angle pt1 pt2) the angle is returned as per your image basleine is zero to right. The only thing would be if want a selected segment then need extra code to work out which segment from the vertice points. So start with C# get pline vertices.
  • maybe something like
    LineSegment2d Polyline.GetLineSegment2dAt(int index);
    LineSegment2d.Direction.Angle, convert to degrees if its radians.