---
title: "cross"
canonical: "https://help.vicon.com/space/Shogun110/13075281/cross"
format: markdown
---
# Description

Returns the right-handed cross product of vector1 and vector2.

The cross product is the vector that is perpendicular to plane containing the two input vectors.

The cross product is not commutative, meaning that cross($a, $b) is not equal to cross($b, $a).

## Functional area

Math

# Command syntax

## Syntax

|  |
| --- |
| `cross vector1 vector2` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `vector1` | vector | yes | Left operand of the cross product. |
| `vector2` | vector | yes | Right operand of the cross product. |

### Flags

None

## Return value

vector

Returns a vector which is the right handed cross product of vector1 and vector2 

> Macro (scroll-pagebreak)

## Examples

```plaintext
vector $a = <<1.0, 0.0, 0.0>>;
vector $b = <<1.0, 1.0, 0.0>>; 
// show that a x b is not equal to b x a 
print("a x b = " + string(cross($a, $b)));
print("b x a = " + string(cross($b, $a)));
```

# Additional information

## Related commands

- [dot](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075325)
- [getAngleTo](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075393)
- [getLength](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075519)
- [normalize](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075729)
- [setLength](https://vicon-help.atlassian.net/wiki/spaces/Shogun110/pages/13075973)