Learn R Programming

dagR (version 1.1.1)

angle: Calculate radian angle of line between two points.

Description

Calculates the radian angle of the line connecting two points. Internally called by smoothArc.

Usage

angle(A, B)

Arguments

A
Vector of length two indicating the coordinates of the first point.
B
Vector of length two indicating the coordinates of the second point.

Value

  • A numeric value [0, 2*pi).

See Also

smoothArc, addAngle

Examples

Run this code
angle(c(0,0), c( 0,-1)) /pi;
angle(c(0,0), c(-1,-1)) /pi;
angle(c(0,0), c(-1, 0)) /pi;
angle(c(0,0), c(-1, 1)) /pi;
angle(c(0,0), c( 0, 1)) /pi;
angle(c(0,0), c( 1, 1)) /pi;
angle(c(0,0), c( 1, 0)) /pi;
angle(c(0,0), c( 1,-1)) /pi;

Run the code above in your browser using DataLab