Learn R Programming

smallstuff (version 1.0.3)

vector3D: Add a Vector to a 3D Coordinate System

Description

Add a Vector to a 3D Coordinate System

Usage

vector3D(pl, v, fr = rep(0, 3), col = "red")

Value

No return value, called for side effects

Arguments

pl

Matrix containing the current plot coordinates.

v

A vector with 3 entries.

fr

The point at which the vector should start (defaults to the origin).

col

Color of the vector (defaults to red).

Examples

Run this code
a=c(2,4,8)
b=c(6,0,4)
pl=coord3D()
vector3D(pl,a)
vector3D(pl,b)
vector3D(pl,a-b,b,3)

Run the code above in your browser using DataLab