point-dot-product

Calculates similarity between direction of pointer movement to another vector (in this case, an upwards vector).

The dot product gets closer to 1 as it matches the vector.

Click and drag.

Pointer vector:
Dot product: