arrow3d: Draw a 3D Arrow in an RGL Scene

Description Usage Arguments Value Author(s) See Also Examples

View source: R/arrow3d.R

Description

Draws a 3D arrow in an rgl scene with barbs at the arrow head

Usage

1
arrow3d(p0 = c(0, 0, 0), p1 = c(1, 1, 1), barblen, s = 0.05, theta = pi/6, n = 3, ...)

Arguments

p0

Initial point (tail of arrow)

p1

Ending point (head of arrow)

barblen

Length of each barb, in data units

s

length of barb as fraction of line length (unless barblen is specified)

theta

opening angle of barbs

n

number of barbs

...

args passed to lines3d for line styling, e.g., color, lwd, etc. See material3d.

Value

Returns (invisibly): integer ID of the line added to the scene

Author(s)

Barry Rowlingson, posted to R-help, 1/10/2010

See Also

lines3d, segments3d,

Examples

1
2
arrow3d(c(0,0,0), c(2,2,2), barblen=.2, lwd=3, col="black")
arrow3d(c(0,0,0), c(-2,2,2), barblen=.2, lwd=3, col="red")

Example output

Loading required package: car
Loading required package: carData
Loading required namespace: rgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 

heplots documentation built on Oct. 7, 2021, 1:07 a.m.