Code covered by the BSD License
-
aaa(A, B, C)
AAA gives both solutions to the angle-angle-angle problem, in radians.
-
aaad(A, B, C)
AAAD gives both solutions to the angle-angle-angle problem, in degrees.
-
aas(A, B, a)
AAS gives both solutions to the angle-angle-side problem, in radians.
-
aasd(A, B, a)
AASD gives both solutions to the angle-angle-side problem, in degrees.
-
acos2(alpha, beta)
-
acos2d(alpha, beta)
-
asa(A, B, c)
ASA gives both solutions to the angle-side-angle problem, in radians.
-
asad(A, B, c)
ASAD gives both solutions to the angle-side-angle problem, in degrees.
-
sas(a, C, b)
SAS gives both solutions to the side-angle-side problem, in radians.
-
sasd(a, C, b)
SASD gives both solutions to the side-angle-side problem, in degrees.
-
ssa(a, b, A)
SSA gives both solutions to the side-side-angle problem, in radians.
-
ssad(a, b, A)
SSAD gives both solutions to the side-side-angle problem, in degrees.
-
sss(a, b, c)
SSS gives both solutions to the side-side-side problem, in radians.
-
sssd(a, b, c)
SSS gives both solutions to the side-side-side problem, in degrees.
-
View all files
from
Oblique Spherical Triangle toolbox
by Rody Oldenhuis
solves the general oblique spherical triangle
|
| asa(A, B, c)
|
function [C1, a1, b1, C2, a2, b2] = asa(A, B, c)
%ASA gives both solutions to the angle-side-angle problem, in radians.
%
% ASA(A, B, c) returns the missing values C, a, b. It uses the
% four-quadrant arccosine function ACOS2 to determine these values.
%
% See also ACOS2, ASAD.
% Rody P.S. Oldenhuis
% Delft University of Technology
% Last edited: 23/Feb/2009
% first solution
% NOTE: normal acos (in stead of acos2) is indeed correct.
C1 = acos( -cos(A).*cos(B) + sin(A).*sin(B).*cos(c));
a1 = acos( (cos(A) + cos(B).*cos(C1))./(sin(B).*sin(C1)));
b1 = acos( (cos(B) + cos(A).*cos(C1))./(sin(A).*sin(C1)));
% second solution
C2 = 2*pi - C1;
a2 = mod((a1 + pi), 2*pi);
b2 = mod((b1 + pi), 2*pi);
end
|
|
Contact us at files@mathworks.com