# cross() Function & Examples

Use the cross() matrix function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## cross

#### cross(A, B)

Try it yourself:

```calculio
cross([1, 1, 0], [0, 1, 1])
cross([3, -3, 1], [4, 9, 2])
cross([2, 3, 4], [5, 6, 7])
```

[multiply](https://calcul.io/function/multiply/index.md)

[dot](https://calcul.io/function/dot/index.md)

---

## Find a perpendicular vector with cross

**cross(A, B)** calculates the cross product of two three-dimensional vectors. The result is perpendicular to both inputs, with direction determined by the right-hand rule and magnitude equal to the area of the parallelogram they span.

## Example and interpretation

`cross([1, 0, 0], [0, 1, 0])` returns `[0, 0, 1]`. Reversing the inputs reverses the result, so order matters. The magnitude is zero for parallel vectors. Use [norm](https://calcul.io/function/norm/index.md) to measure the output length, and [dot](https://calcul.io/function/dot/index.md) to check perpendicularity: the dot product of the cross result with either original vector is zero.

## Applications

Cross products produce surface normals in 3D graphics, torque in mechanics, and oriented area in geometry. Normalize the result when only direction is required. For matrix and vector multiplication, use [multiply](https://calcul.io/function/multiply/index.md); a cross product is a specific geometric operation, not general multiplication.

## Input requirements

Both inputs must represent compatible three-component vectors. Do not use cross for two-dimensional vectors unless you deliberately embed them in 3D with a zero z-component. Check shapes with [size](https://calcul.io/function/size/index.md), and use [subtract](https://calcul.io/function/subtract/index.md) to form direction vectors from pairs of points before applying cross.

[All functions](https://calcul.io/functions/index.md)
