getpolar: Calculates the angle of the link between two points to the...

Description Usage Arguments Value Optional Parameters (...) Author(s) References Examples

Description

This function calculates the angle of a vector defined by two points in radians. Optionally it can be converted to degrees. For the use of the Operations-Research-Sweep-Algorithm an offset angle can be set. It's als possible return positive values only (2pi will be added).

Usage

1
2
3
4
5
6
7
getpolar(n0, n1, ...)

## S4 method for signature 'numeric,numeric'
getpolar(n0 = c(0, 0), n1, ...)

## S4 method for signature 'Node,Node'
getpolar(n0, n1, ...)

Arguments

n0

an object of class numeric with a length of 2 (x/y-coordinates) or a class derived from Node. Used as origin.

n1

an object of class numeric with a length of 2 (x/y-coordinates) or a class derived from Node.

...

see Optional Values

Value

the angle as a value of class numeric.

Optional Parameters (...)

used by getpolar

nonnegative

optional logical. Indicating if 2pi should be added to negative values. Default is TRUE

deg

optional logical. Indicating if the result should be converted to degrees. Default is FALSE

log

optional logical. Indicating if the calculations should be logged. Default is FALSE

offset

optional numeric. Should be when using rotated coordinate systems. Default is 0. Has to be provided in RADIANS!

Forwarded to the follwowing functions

Author(s)

Dipl. Kfm. Felix Lindemann felix.lindemann@hs-neu-ulm.de

Wissenschaftlicher Mitarbeiter Kompetenzzentrum Logistik Buro ZWEI, 17

Hochschule fur angewandte Wissenschaften Fachhochschule Neu-Ulm | Neu-Ulm University Wileystr. 1

D-89231 Neu-Ulm

Phone +49(0)731-9762-1437 Web www.hs-neu-ulm.de

References

Bronstein 2008 Bronstein, I. N.: Taschenbuch der Mathematik. [CD-ROM-Ausg. der 7., voll. ueberarb. und erg. gedr. Ausg.]. Frankfurt: Harri Deutsch, 2008

Examples

1
2
3
4
# getpolar(c(1,1),c(0,0),deg=TRUE) # should result 45.
# w1 <- new("Node", x=0, y=0)
# c1 <- new("Node",  x=1, y=1)
# getpolar(w1,c1,deg=TRUE) # should result 45.

felixlindemann/HNUORTools documentation built on May 8, 2019, 6:46 p.m.