---
title: "getAngleTo"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737805/getAngleTo"
format: markdown
---
# Description

Returns the angle between two vectors, in degrees.

## Functional area

Math

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `getAngleTo vector1 vector2` |

### Arguments

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `vector1` | vector | yes | This is an (unordered) input vector in getAngleTo |
| `vector2` | vector | yes | This is an (unordered) input vector in getAngleTo |

### Flags

None

## Return value

float

Returns the absolute value of the angle between vector1 and vector2

> Macro (scroll-pagebreak)

## Examples

```plaintext
vector $v1 = <<1, 0, 0>>;
vector $v2 = <<0, 1, 0>>;
// show that getAngleTo returns the absolute value of the angle 
// between two orthogonal vectors (90 degrees) regardless of
// ordering between vector1 and vector2
print( getAngleTo($v1, $v2)) ;
print( getAngleTo($v2, $v1)) ;
```

# Additional information

## Related commands

- [cross](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736892)
- [dot](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736972)
- [getLength](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737337)
- [normalize](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736816)
- [setLength](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736736)