rotatePt_2D: Rotate a 2D point

View source: R/geom_rotate.R

rotatePt_2DR Documentation

Rotate a 2D point

Description

Rotates a 2D point by a given angle (counter-clockwise)

Usage

rotatePt_2D(x, y, angle)

Arguments

x

X-axis coordinate of the point to be rotated

y

Y-axis coordinate of the point to be rotated

angle

Rotation angle, given in radians

Value

A vector containing the rotated coordinates (x,y)

Author(s)

Cornel M. Pop

Examples

x = 1.5
y = 0
a = 0.2
pt.r = rotatePt_2D(x, y, a) # 1.4701, 0.298004

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.