Util method for 2D dot product

Static util method for 2D dot product.