Learn R Programming

smallstuff (version 1.0.3)

vector2D: Add a Vector to a 2D Coordinate System

Description

Add a Vector to a 2D Coordinate System

Usage

vector2D(v, fr = c(0, 0), col = 2)

Value

No return value, called for side effects

Arguments

v

A vector with 2 entries.

fr

Vector containing 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)
b=c(0,3)
coord2D()
vector2D(a)
vector2D(b)
vector2D(a-b,b,"blue")

Run the code above in your browser using DataLab