better.acos: Calculate The Inverse Of Cosine

View source: R/better_acos.R

better.acosR Documentation

Calculate The Inverse Of Cosine

Description

This function is a wrapper around the standard acos function, which returns the corresponding angle between 0 and pi for any output of the cosine function. This wrapper is able to return an angle between 0 and 2pi by looking at the sides of a right angled triangle. The angle this function returns is placed at the origin of a cartesian coordinate system and spans between the hypotenuse and the adjacent side. The sign of the opposite side enables this function to return angles between 0 and 2pi.

Usage

better.acos(hypotenuse, adjacent, oppisite)

Arguments

hypotenuse

Length of the a triangles hypotenuse

adjacent

Signed length of an angles adjacent side. The sign describes the direction the triangle is pointing in a cartesian coordinate system

oppisite

Signed length of an angles oppisite side. The sign describes the direction the triangle is pointing in a cartesian coordinate system

Value

Angle between the x-axis and the hypotenuse of an arbitrary triangle


AlreadyTakenJonas/RHotStuff documentation built on Oct. 28, 2022, 10:15 p.m.