sphcos: The Spherical Cosine Function

View source: R/sphcos.R

sphcosR Documentation

The Spherical Cosine Function

Description

Use the spherical cosine function to calculate the length of a side or size of an angle in a spherical triangle.

Usage

sphcos(d1, d2, d3, theta, rad = 1)

Arguments

d3

If the size of an angle is to be calculated, the length of the side opposite that angle. Otherwise, must be set to NULL.

theta

If the length of a side is to be calculated, the size of the angle opposite that side. Otherwise, must be set to NULL.

d1, d2

The lengths of the other two sides

rad

The radius of the sphere

Details

This function can be used to either calculate an angle in a spherical triangle when the lengths of all three sides are known, or the length of a side of a spherical triangle when the size of the angle opposite it and the lengths of the other two sides are known. The calculation performed depends on whether d3 or theta is set to NULL; the variable set to NULL is the one for which this function calculates the value. If both d3 and theta (or neither) are set to NULL, an error is generated.

The distances given to this function should be across the surface of the sphere (i.e. not Euclidean), the size of the angle (if this function is used to calculate the length of the opposite side) should be given in radians.

Value

If sphcos is used to calculate the length of a side, that length is given across the surface of the sphere; if sphcos is used to calculate the size of an angle, it is given in radians.

Author(s)

Tom Lawrence <email:tjlawrence@bigpond.com>

References

Lawrence, T.J. (2017) Master's Thesis, University of Western Australia.

See Also

sphsin (spherical sine function), sph.angles (calculate the sizes of all angles in a spherical polygon), cround, sround,

Examples

sphcos(d1=pi/2, d2=pi/2, d3=pi/3, theta=NULL, rad=1)

sphcos(d1=pi/2, d2=pi/2, d3=NULL, theta=pi/3, rad=1)

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.