dot(x, y)
x
and
y
.x
and y
are column or row vectors, their dot product
will be computed as if they were simple vectors.cross
dot(1:5, 1:5) #=> 55
# Length of space diagonal in 3-dim- cube:
sqrt(dot(c(1,1,1), c(1,1,1))) #=> 1.732051
Run the code above in your browser using DataLab