ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:rotatevector

Table of Contents

RotateVector

Description

Returns the 2D vector rotated by angle.

Examples

RotateVector(x, y, angle);
int newX = r1;
int newY = r2;

Rotate a point around the origin

RotateVector(x - originX, y - originY, angle);
int newX = r1 + originX;
int newY = r2 + originY;
Use RotatePoint instead of the example code above.
functions/rotatevector.txt · Last modified: 2017/03/17 18:05 by korshun