getBezierCurve: Calculate x and y Coordinates for A Quadratic Bezier Curve

Description Usage Arguments Value Author(s) Examples

View source: R/caOmicsV.bioNetCircos.R

Description

Calculate x and y coordinates for a quadratic Bezier curve between two points with the equation: B(t) = (1-t) ((1-t)P0 + tP1) + t((1-t)P1 + tP2) where P0 is the start point, P2 is the end point, and P1 is the control point. P1 will be adjusted based on the distance of two points.

Usage

1
    getBezierCurve(lineStart, lineEnd, totalPoints)

Arguments

lineStart

numeric vector, the coordinate of a point where Bezier line starts

lineEnd

numeric vector, the coordinate of a point where Bezier line ends

totalPoints

non-negative numeric, total number of points that form a Bezier line

Value

posX

x coordinates of points that form Bezier line

posY

y coordinates of points that form Bezier line

Author(s)

Henry Zhang

Examples

1
2
3
4
    lineStart   <- c(0, 1)
    lineEnd     <- c(1, 0)
    totalPoints <- 2000
    the_line <- getBezierCurve(lineStart, lineEnd, totalPoints)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: bc3net
Loading required package: c3net
Loading required package: infotheo
Loading required package: Matrix
Loading required package: lattice

caOmicsV documentation built on Nov. 8, 2020, 8:23 p.m.