vec_math
Class Spherical

java.lang.Object
  extended by vec_math.Spherical

public class Spherical
extends Object

A class with statical methods used in spherical trigonometrie. Introduced on 5th Dec 2000, still growing.


Constructor Summary
Spherical()
           
 
Method Summary
static double cosineAngle(double beta, double gamma, double a)
          The second law of cosine in the spherical triangle.
static double cosineSide(double b, double c, double alpha)
          The first law of cosine in the spherical triangle.
static double orthodrome(double lam1, double phi1, double lam2, double phi2)
          Returns the minimal distance between the to specified position.
static double sine(double b, double alpha, double beta)
          The law of sine in the spherical triangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spherical

public Spherical()
Method Detail

cosineSide

public static double cosineSide(double b,
                                double c,
                                double alpha)
The first law of cosine in the spherical triangle. Given two sides of the triangle, e.g. b and c together with the enclosed angle, alpha, calculates the cosine of the opposite side.

Parameters:
b - Side of triangle (radians)
c - Side of triangle (radians)
alpha - Enclosed angle (radians)
Returns:
The cosine of the opposite side.

cosineAngle

public static double cosineAngle(double beta,
                                 double gamma,
                                 double a)
The second law of cosine in the spherical triangle. Given two angles of the triangle, e.g. beta and gamma together with the adjacent side, a, this method returns the cosine of the opposite angle.

Parameters:
beta - Angle of triangle (radians)
gamma - Angle of triangle (radians)
a - Side of triangle (radians)
Returns:
The cosine of the opposite angle.

sine

public static double sine(double b,
                          double alpha,
                          double beta)
The law of sine in the spherical triangle. Can be used for sides and angles. If you want to calculate the sine of a side, remeber that you specify a side as the first argument, followed by the opposite angle of the side you want to calculate, followed by the angle opposite to the side you specified in the first command. Accordingly, using this routine for angles, give the known angle as the first argument, followed by the opposite sides of the unknown and known angle, respectively.

Parameters:
b - Side/angle of the triangle (radians)
alpha - Angle/side opposite to the unknown side/angle (radians)
beta - Angle/side opposite to the known side/angle (radians)
Returns:
The sine of the unknown side/angle.

orthodrome

public static double orthodrome(double lam1,
                                double phi1,
                                double lam2,
                                double phi2)
Returns the minimal distance between the to specified position. This minimal distance is the length of the part of the major circle combining the two points. It is called an orthodrome.

Parameters:
lam1 - The latitude of the first point (radians)
phi1 - The longitude of the first point (radians)
lam2 - The latitude of the second point (radians)
phi2 - The longitude of the second point (radians)
Returns:
The orthodromic distance in radians.