View source: R/calc_spherical_distance.R
| calc_spherical_distance | R Documentation |
Computes the angular distance, in radians, between directions defined by zenith and azimuth angles on the unit sphere.
calc_spherical_distance(z1, a1, z2, a2)
z1 |
numeric vector. Zenithal angle in radians. |
a1 |
numeric vector. Azimuthal angle in radians. |
z2 |
numeric vector of length one. Zenithal angle in radians. |
a2 |
numeric vector of length one. Azimuthal angle in radians. |
This function calculates the angle between two directions originating from the center of a unit sphere, using spherical trigonometry. The result is commonly referred to as spherical distance or angular distance. These terms are interchangeable when the sphere has radius one, as is standard in many applications, including celestial coordinate systems and, by extension, canopy hemispherical photography.
Spherical distance corresponds to the arc length of the shortest path between two points on the surface of a sphere. When the radius is one, this arc length equals the angle itself, expressed in radians.
Numeric vector of the same length as z1 and a1, containing the
spherical distance (in radians) from each (z1, a1) point to the
reference direction (z2, a2).
set.seed(1)
z1 <- rnorm(10, 45, 20) * pi/180
a1 <- rnorm(10, 180, 90) * pi/180
calc_spherical_distance(z1, a1, 0, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.