rcosmo (version 1.1.2)

geoAngle: Angle between two spherical directions

Description

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

Usage

geoAngle(p1)

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

Run this code
# NOT RUN {
  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)

# }

Run the code above in your browser using DataLab