Learn R Programming

caOmicsV (version 1.2.0)

getBioNetNodeLinkLine: Get X and Y Coordinates for An Arrow between Two Nodes

Description

Calculate x and y coordinates for an customized arrow head and tail with defined length to connect two nodes.

Usage

getBioNetNodeLinkLine(lineX, lineY, arrowSize=1, lineLength)

Arguments

lineX
numeric vector, x coordinates of the link line
lineY
numeric vector, y coordinates of the link line
arrowSize
non-negative numeric, scaling factor for arrow size, default 1
lineLength
non negative integer, the length of link line

Value

A two dimensional numeric matrix for x and y coordinates of the arrow.

Details

An arrow is drawn as a polygon. By default, the arrow is in inside of a circle (radius 1) without tail and it points to radian 0. The tail, if any, will be added to the left.

Examples

Run this code
    from <- c(1, 1)
    to   <- c(2, 2)
    lineX <- seq(from[1], to[1], 1000)
    lineY <- seq(from[2], to[2], 1000)

    lineLength <- sqrt((from[1]-to[1])^2 + (from[2]-to[2])^2)
    positions <- getBioNetNodeLinkLine(lineX, lineY, arrowSize=1, lineLength)

Run the code above in your browser using DataLab