---
name: "BIS_fnc_rotateVector2D"
type: function
status: ok
groups: ["Vectors"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_rotateVector2D
revid: 348898
updated: 2023-11-08T14:39:55Z
---

# BIS_fnc_rotateVector2D

*Function · Vectors · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

This function returns a 2D vector rotated a specified number of degrees around the origin.

## Syntax

```sqf
[vector2D, angle] call BIS_fnc_rotateVector2D
```

**Parameters:**

- `vector2D`: [Array](../topics/Array.md) - 2D vector
- `angle`: [Number](../topics/Number.md) - angle in degree

**Returns:** [Array](../topics/Array.md) - new vector

## Examples

### Example 1

```sqf
[[5,3], 60] call BIS_fnc_rotateVector2D;//Returns[-0.0980766,5.83013]
```

## See also

[BIS_fnc_crossProduct](../functions/BIS_fnc_crossProduct.md) · [BIS_fnc_magnitudeSqr](../functions/BIS_fnc_magnitudeSqr.md) · [BIS_fnc_vectorFromXToY](../functions/BIS_fnc_vectorFromXToY.md)

## Community notes

**AgentRev** — 2015-01-21

Be careful when using this function in conjunction with [getDir](../commands/getDir.md) or [BIS_fnc_dirTo](../functions/BIS_fnc_dirTo.md), which return a clockwise angle, while the rotation is done counterclockwise as per trigonometric conventions.

To counter this, simply negate their output:

```sqf
[[0,1,0], -(getDir _object)] call BIS_fnc_rotateVector2D;
[[0,1,0], -([_unit, _vehicle] call BIS_fnc_dirTo)] call BIS_fnc_rotateVector2D;
```

<sub>Source: [BI Community Wiki — BIS fnc rotateVector2D](https://community.bistudio.com/wiki/BIS_fnc_rotateVector2D) (revision 348898).</sub>
