Sub Button3_Click
Dim zz(6) As Double
zz(0) = 0
zz(1) = 90
zz(2) = 0
zz(3) = 30
zz(4) = 2
zz(5) = 0
zz = JHSMATH.Triangle_AAS(zz)
End Sub
'the following code is in a module named JHSMATH
Public Sub Triangle_AAS (aa() As Double) as Double()
Dim s1 As Double
Dim s2 As Double
Dim s3 As Double
Dim a1 As Double
Dim a2 As Double
Dim a3 As Double
s3 = aa(4)
a1 = aa(1)
a2 = aa(3)
a3 = 180 - a1 - a2
a2 = (a2/360)*2*cPI
a1 = (a1/360)*2*cPI
a3 = (a3/360)*2*cPI
s2 = s3 * Sin(a3) / Sin(a1)
s1 = s3 * Sin(a2) / Sin(a1)
a1 = 360*a1/(2*cPI)
a2 = 360*a2/(2*cPI)
a3 = 360*a3/(2*cPI)
a1 = NumberFormat2(a1,0,3,3,False)
a2 = NumberFormat2(a2,0,3,3,False)
a3 = NumberFormat2(a3,0,3,3,False)
s1 = NumberFormat2(s1,0,3,3,False)
s2 = NumberFormat2(s2,0,3,3,False)
s3 = NumberFormat2(s3,0,3,3,False)
aa(0) = s1
aa(1) = a1
aa(2) = s2
aa(3) = a2
aa(4) = s3
aa(5) = a3
Return aa
End Sub