Learn R Programming

treePlotArea (version 3.1.0)

vector_length: Give the Length of a Vector

Description

A vector given by two points in a plane.

Usage

vector_length(p1, p2 = c(0, 0))

Value

The length of the vector.

Arguments

p1

The first point (x, y).

p2

The second point (x, y).

See Also

Other geometry functions: get_intersection(), points2equation()

Examples

Run this code
p1 <- c(0, 4)
vector_length(p1)
p2 <- c(3, 4)
vector_length(p1, p2)

Run the code above in your browser using DataLab