Sect2vex: Intersect 2 Vectors

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Sect2vex.R

Description

Finder intersection point of two vectors in a plane

Usage

1
Sect2vex(V1, V2)

Arguments

V1

vector of 2 points

V2

vector of 2 points

Details

if vectors are parallel return NULL

Value

x-y location of intersection

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

AXB.prod

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
v1 = matrix(runif(4), ncol=2)
v2 =  matrix(runif(4), ncol=2)


pt = Sect2vex(v1, v2)

plot(c(v1[,1],v2[,1],pt[1] ) , c(v1[,2],v2[,2],pt[2]) , asp=1)

arrows(v1[1,1], v1[1,2], v1[2,1], v1[2,2])
arrows(v2[1,1], v2[1,2], v2[2,1], v2[2,2])

points(pt[1], pt[2], col='red', cex=2, pch=3)

geophys documentation built on May 19, 2017, 12:56 p.m.

Search within the geophys package
Search all R packages, documentation and source code