kcl-std → functions → vector::cross

vector::crossFunction in std::vector

Find the cross product of two 3D points or vectors.

vector::cross(
  @u: Point3d,
  v: Point3d,
)

Arguments

NameTypeDescriptionRequired
uPoint3dA point in three dimensional space.Yes
vPoint3dA point in three dimensional space.Yes

Examples

vx = [1, 0, 0]
vy = [0, 1, 0]
vz = vector::cross(vx, v = vy)
assert(vz[0], isEqualTo = 0)
assert(vz[1], isEqualTo = 0)
assert(vz[2], isEqualTo = 1)

Rendered example of vector::cross 0

Found a typo?