Translating concave hull algorithm to c#

前端 未结 4 1096
盖世英雄少女心
盖世英雄少女心 2021-01-04 21:31

So I am trying to translate the algorith found here for concave hulls: http://repositorium.sdum.uminho.pt/bitstream/1822/6429/1/ConcaveHull_ACM_MYS.pdf

(Page 65)

4条回答
  •  离开以前
    2021-01-04 22:14

    What about that?

    private List sortClockwiseFromCentroid(List points, Vector center)
        {
            points = points.OrderBy(x => Math.Atan2(x.X - center.X, x.Y - center.Y)).ToList();
            return points;
        }
    

提交回复
热议问题