sphsin: Spherical Sine Function

View source: R/sphsin.R

sphsinR Documentation

Spherical Sine Function

Description

Given the length of one side of a spherical triangle and size of the angle opposite, this function can calculate the length of another side of the triangle (given also the size of the angle opposite it), or the size of another angle in the triangle (given also the length of the side opposite it).

Usage

sphsin(d1, d2, theta1, theta2, rad = 1)

Arguments

d1

The length of the known side (opposite the angle of known size)

d2

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

theta1

The size of the known angle (opposite the side of known length)

theta2

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

rad

The radius of the sphere

Details

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

The distance(s) given to this function should be across the surface of the sphere (i.e. not Euclidean), the size of the angle (s) should be given in radians.

Value

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

Author(s)

Tom Lawrence <email: tjlawrence@bigpond.com>

See Also

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

Examples

sphsin(d1=pi/2, d2=NULL, theta1=pi/2, theta2=pi/3, rad=1)

sphsin(d1=pi/2, d2=pi/3, theta1=pi/2, theta2=NULL, rad=1)

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