CPKit
v1.6.1

Formula Center (KaTeX format references)

Computational geometry is highly dependent on cross products and orientations:

  • Cross Product 2D: $u \times v = u_x v_y - u_y v_x$ representing signed parallelogram areas.
  • Shoelace Formula: $Area = \frac{1}{2} | \sum (x_i y_{i+1} - x_{i+1} y_i) |$ for polygon areas.

Competitive Programming Tips

To prevent floating point precision bugs when writing geometry code:

  • Use Integer Types: Whenever possible, keep coordinates and cross product calculations in `long long` integers.
  • Epsilon Tolerances: When floats are mandatory, use `const double eps = 1e-9` for inequality checks.