geoAngle: Angle between two spherical directions

Description Usage Arguments Value Examples

View source: R/Geometry.R

Description

Get an angle between two directions defined by arcs on the unit sphere

Usage

1

Arguments

p1

A data.frame with rows specifying numeric points located on the unit sphere. It should have columns labelled x,y,z for Cartesian or theta, phi for spherical colatitude and longitude respectively.

Value

Let p1[1,], p1[2,], and p1[3,] denote the rows of p1. Then the returned object is an angle in radians beween two arcs determined by #'the pairs #'of spherical points (p1[1,], p1[2,]) and (p1[2,], p1[3,]) respectively.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  p1 <- data.frame(diag(3))
  p1
  colnames(p1) <- c("x", "y", "z")
  geoAngle(p1)

  geo <- data.frame( lat = c(30, 0, 20), lon = c(30, 60, 10))*(pi/180)
  geo
  p2 <- geo2sph(geo)
  p2
  geoAngle(p2)

rcosmo documentation built on Feb. 14, 2020, 5:06 p.m.