Learn R Programming

astronomyengine (version 0.1.0)

astro_rotate_vector: Apply a rotation to a vector

Description

This function transforms a vector in one orientation to a vector in another orientation.

Usage

astro_rotate_vector(rotation, vector)

Value

A vector in the orientation specified by rotation

Arguments

rotation

A rotation matrix that specifies how the orientation of the vector is to be changed

vector

The vector whose orientation is to be changed. A list with components:

x

The Cartesian x-coordinate in AU

y

The Cartesian y-coordinate in AU

z

The Cartesian z-coordinate in AU

t

The date and time (POSIXct) at which this vector is valid

Examples

Run this code
# Create a vector and rotate it
vec <- list(x = 1, y = 0, z = 0, t = as.POSIXct("2024-01-01", tz = "UTC"))
rot <- astro_identity_matrix()
rotated <- astro_rotate_vector(rot, vec)

Run the code above in your browser using DataLab