rotate_vec_ccw: Rotate 2D vectors by an angle (counter-clockwise)

View source: R/utils.R

rotate_vec_ccwR Documentation

Rotate 2D vectors by an angle (counter-clockwise)

Description

Internal utility to rotate 2D coordinates by a given angle (in radians), using a standard rotation matrix.

Usage

rotate_vec_ccw(x, y, theta)

Arguments

x

Numeric vector of x coordinates.

y

Numeric vector of y coordinates.

theta

Rotation angle in radians (counter-clockwise).

Details

The rotation follows:

x' = x \cos(\theta) - y \sin(\theta)

y' = x \sin(\theta) + y \cos(\theta)

Value

A data.frame with rotated coordinates:

x

Rotated x coordinates

y

Rotated y coordinates


SamsaRaLight documentation built on April 16, 2026, 5:08 p.m.