Transformation to get rid of collinear points

前端 未结 2 936
眼角桃花
眼角桃花 2021-01-22 01:15

I\'m writing a program to solve a geometry problem.

My algorithm doesn\'t treat collinear point very well.

Is there any transformation I can apply to the points

2条回答
  •  情深已故
    2021-01-22 02:01

    Then I think that noise might actually be the solution. As I wrote in the comment above

    One way to remove colinearity is simply to add some noise to each point, i.e. (x, y, z) ↦ (x + 0.01*(random() - 0.5), y + 0.01*(random() - 0.5), z + 0.01(random() - 0.5)) if random() returns a random real number in [0, 1[.

提交回复
热议问题