레퍼런스 cross()

cross()

Calculates the cross product of two vectors.

The cross product is a vector that points straight out of the plane created by two vectors. The cross product's magnitude is the area of the parallelogram formed by the original two vectors.

The cross product is defined on 3-dimensional vectors, and will use the x, y, and z components. This method should only be used with 3D vectors.

The static version of cross(), as in p5.Vector.cross(v1, v2), is the same as calling v1.cross(v2).

예제

구문

cross(v)

매개변수

v
p5.Vector: p5.Vector to be crossed.

반환값

p5.Vector: cross product as a p5.Vector.

관련 레퍼런스