private static double cos(double ax, double ay, double bx, double by, double cx, double cy) {
    double den = Math.hypot(bx - ax, by - ay) * Math.hypot(cx - bx, cy - by),
      cos = 0;
    if (den > 0) {
      cos = Math.clamp(((ax - bx) * (cx - bx) + (ay - by) * (cy - by)) / den, -1, 1);
    }
    return cos;
  }
Apply a penalty from {@code k=0} to {@code k=1} to drop more sharp corners from the resulting geometry.
<p>
{@code k=0} is the default to apply no penalty for corner sharpness and just drop based on effective triangle area
at the vertex. {@code k=0.7} is the recommended setting to drop corners based on weighted effective area.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/VWSimplifier.java