calculate the distance between two points
float distance(float p0, float p1)
float distance(vec2 p0, vec2 p1)
float distance(vec3 p0, vec3 p1)
float distance(vec4 p0, vec4 p1)
p0
: Specifies the first of two pointsp1
: Specifies the second of two pointsdistance
returns the distance between the two points p0
and p1
. i.e., length(p0 - p1);