ArcIntersection: Point(s) at which two arcs intersect on a sphere

Description Usage Arguments Details Value Author(s) Examples

View source: R/ArcIntersection.R

Description

Given two arcs returns point(s) at which they intersect on a sphere.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
ArcIntersection(
  longitude_1,
  latitude_1,
  longitude_2,
  latitude_2,
  longitude_3,
  latitude_3,
  longitude_4,
  latitude_4,
  type = c("arc", "arc"),
  EarthRad = 6367.4447
)

Arguments

longitude_1

Decimalised longitude of first point on first arc.

latitude_1

Decimalised latitude of first point on first arc.

longitude_2

Decimalised longitude of second point on first arc.

latitude_2

Decimalised latitude of second point on first arc.

longitude_3

Decimalised longitude of first point on second arc.

latitude_3

Decimalised latitude of first point on second arc.

longitude_4

Decimalised longitude of second point on second arc.

latitude_4

Decimalised latitude of second point on second arc.

type

Vector to indicate if elements are arcs or Great Circles.

EarthRad

Earth radius in kilometres.

Details

Assumes shortest distance between points describes arc. Can define Great Circle-arc intersection with type option.

Value

Matrix of longitude-latitude points at which intersection(s) occur.

Author(s)

Graeme T. Lloyd graemetlloyd@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
longitude_1 <- stats::runif(1, -180, 180)
longitude_2 <- stats::runif(1, -180, 180)
longitude_3 <- stats::runif(1, -180, 180)
longitude_4 <- stats::runif(1, -180, 180)
latitude_1 <- stats::runif(1, -90, 90)
latitude_2 <- stats::runif(1, -90, 90)
latitude_3 <- stats::runif(1, -90, 90)
latitude_4 <- stats::runif(1, -90, 90)
ArcIntersection(longitude_1, latitude_1, longitude_2, latitude_2,
  longitude_3, latitude_3, longitude_4, latitude_4, EarthRad = 6367.4447)

laurasoul/dispeRse documentation built on May 25, 2021, 4:50 a.m.