powered by
Calculates the length of a vector using the Pythagorean theorem.
pythagoras(x, y)
Returns a numeric
numeric
vector with the same length as x and y, reflecting the lengths of the hypotenuse of the right triangles.
vector
x
y
A numeric vector with the same length as y. It should represent the lengths of the first leg (cathetus) of right triangles.
A numeric vector with the same length as x. It should represent the lengths of the second leg (cathetus) of right triangles.
Pepijn de Vries
pythagoras(x = c(1, 2), y = c(1, 2))
Run the code above in your browser using DataLab