calculate the dot product of two vectors
float dot(float x, float y)
float dot(vec2 x, vec2 y)
float dot(vec3 x, vec3 y)
float dot(vec4 x, vec4 y)
x
: Specifies the first of two vectorsy
: Specifies the second of two vectorsdot
returns the dot product of two vectors, x
and y
. i.e.,
$$
x[0] \cdot y[0] + x[1] \cdot y[1] + \ldots
$$