anglefix: Angle difference fixer

Description Usage Arguments Details Value

Description

Resolves discontinuity artefacts when calculating angle differences by always selecting the shortest of the two rotations.

Usage

1
anglefix(a, deg = F)

Arguments

a

an angle in rad from -2pi (anticlockwise) to +2pi (clockwise)

deg

boolean if you want to enter it in degrees. I don't think it works yet

Details

Takes an angle (in rad: from -2pi to 2pi; or in degrees: from -360 to 360) and if it's larger than half a circle replaces it with the shortest distance between the same points (in the opposite direction).

I don't think the degree version quite works yet.

Value

An angle that is always between -pi and pi


PaolaCognigni/CTraxHelper documentation built on May 7, 2019, 11:57 p.m.