Computational geometry notes

  • Judge which side of the line the point is, you can use the cross product to judge
  • To determine whether the line segment is crossed by a straight line, you can see whether the two end points of the line segment are on both sides of the line
  • To determine whether a line segment and a line segment intersect, you can first determine a rapid rejection experiment, and then determine a straddle experiment. (Actually, the rapid rejection experiment is not judged, but it is also possible to judge two straddle experiments) I feel this blog post is good
  • The problem similar to the convex hull can be solved by sorting the polar angle, using the cross product (AC is in the clockwise direction of AB if and only if |ABxAC|<0)
  • Triangle correlation

    • SABC=12A B×AC S △ A B C = 1 2 ⋅ | A B → × A C → |
      <script type="math/tex; mode=display" id="MathJax-Element-15">S_{\triangle ABC} = \frac{1}{2} \cdot \left |\vec{AB}\times \vec{AC} \right |</script>
      • Is actually the determinant
      • Then this can be extended to the area of ​​a convex polygon, which is to divide it into multiple triangles
      • You can also use this when taking math exams. On the surface, you can write Helen's formula, but in fact, it will be much faster to list the formula and use this on the draft paper.
    • I=aA+bB+cCa+b+c I = a ⋅ A + b ⋅ B + c ⋅ C a + b + c
      <script type="math/tex; mode=display" id="MathJax-Element-16">I= \frac{a \cdot A+b \cdot B +c \cdot C }{a+b+c}</script>
      • I is the center of the triangle, the uppercase letters are the point coordinates, and the lowercase letters are the corresponding side lengths.
      • In fact, capital letters should all be vectors, but there is not much difference in the program, so just write them like this, which is more intuitive.
      • You can use the Mercedes-Benz theorem to prove it.
  • Green formula Haven't figured it out yet...

Guess you like

Origin blog.csdn.net/jackypigpig/article/details/78629593