Calculate curvature for 3 Points (x,y)

后端 未结 4 1245
礼貌的吻别
礼貌的吻别 2021-01-13 12:22

I have a two dimensional euclidean space. Three points are given.

For example (p2 is the middle point):

Point2D p1 = new Point2D.Double(177, 289);
Po         


        
4条回答
  •  没有蜡笔的小新
    2021-01-13 12:43

    From the wiki you referenced, the curvature is defined as

    where A is the area enclosed by the triangle formed by the three points, x, y and z (p1, p2, p3 in your case) and |x-y| is the distance between points x and y.

    Translate the formula to code and you're done!

提交回复
热议问题