compute_frame_orientation: Compute Frame Orientation

View source: R/compute_frame_orientation_df.R

compute_frame_orientationR Documentation

Compute Frame Orientation

Description

This function computes frame orientation based on two input vectors.

Usage

compute_frame_orientation(v1, v2, recompute, frameorder)

Arguments

v1

A numeric matrix or data frame where each row represents a vector.

v2

A numeric matrix or data frame where each row represents a vector.

recompute

An integer indicating whether to recompute the orientation:

  • 1: Recompute u1 as the cross product of u2 and u3.

  • 2: Recompute u2 as the cross product of u3 and u1.

frameorder

A numeric vector of length 3 specifying the order of the frames.

Value

A 3-dimensional array where each slice corresponds to a 3x3 orientation matrix.

Examples

v1 <- matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1), nrow = 3, byrow = TRUE)
v2 <- matrix(c(0, 1, 0, 0, 0, 1, 1, 0, 0), nrow = 3, byrow = TRUE)
recompute <- 1
frameorder <- c(1, 2, 3)
compute_frame_orientation(v1, v2, recompute, frameorder)

Kneerav/biomechanics documentation built on March 30, 2025, 12:56 a.m.