dot function

num dot(
  1. num x1,
  2. num y1,
  3. num x2,
  4. num y2
)

Implementation

num dot(num x1, num y1, num x2, num y2) {
  return x1 * x2 + y1 * y2;
}