注册 登录
Office中国论坛/Access中国论坛 返回首页

5988143的个人空间 http://www.office-cn.net/?10050 [收藏] [复制] [分享] [RSS]

日志

Trigonometric functions:

已有 3361 次阅读2009-2-12 14:15 |

Public Const cstPi As Double = 3.14159265389793
Public Const cstE As Double = 2.71828182845905

'Degrees -> radians


Public Function DegToRad(ByVal dblDeg)
  DegToRad = cstPi * dblDeg / 180
End Function

'Radiant -> degree


Public Function RadToDeg(ByVal dblRad)
  RadToDeg = 180 * dblRad / cstPi
End Function

'Arc sine


Public Function Acs(ByVal dblX As Double)
  If dblX = 0 Then
    Acs = cstPi / 2
  Else
    Acs = Atn(Sqr(1 - dblX * dblX) / dblX)
  End If
End Function

' ArcusCotangens

Public Function Act(ByVal dblX As Double)
  If dblX = 0 Then
    Act = cstPi / 2
  Else
    Act = Atn(1 / dblX)
  End If
End Function

' Area Cosinus Hyperbolicus

Public Function ArCosh(ByVal dblX As Double)
  ArCosh = Log(dblX + Sqr(dblX * dblX - 1))
End Function

' Area Cotangens Hyperbolicus

Public Function ArCoth(ByVal dblX As Double)
  ArCoth = 0.5 * Log((1 - dblX) / (1 + dblX))
End Function

' Area Sinus Hyperbolicus

Public Function ArSinh(ByVal dblX As Double)
  ArSinh = Log(dblX + Sqr(dblX * dblX + 1))
End Function

' Area Tangens Hyperbolicus

Public Function ArTanh(ByVal dblX As Double)
  ArTanh = 0.5 * Log((1 + dblX) / (1 - dblX))
End Function

' Arcus Sinus

Public Function Asn(ByVal dblX As Double)
  If Abs(dblX) = 1 Then
    Asn = Sgn(dblX) * cstPi / 2
  Else
    Asn = Atn(dblX / Sqr(1 - dblX * dblX))
  End If
End Function

' Cosinus: Cos()

' CosinusHyperbolicus

Public Function Cosh(ByVal dblX As Double)
  Cosh = (cstE ^ dblX + cstE ^ -dblX) / 2
End Function

' Cotangens

Public Function Cot(ByVal dblRad As Double)
  Cot = 1 / Tan(dblRad)
End Function

' CotangensHyperbolicus

Public Function Coth(ByVal dblX As Double)
  Coth = Cosh(dblX) / Sinh(dblX)
End Function

' Sinus: Sin()

' SinusHyperbolicus

Public Function Sinh(ByVal dblX As Double)
  Sinh = (cstE ^ dblX - cstE ^ -dblX) / 2
End Function

' Tangens: Tan()

' TangensHyperbolicus

Public Function Tanh(ByVal dblX As Double)
  Tanh = Sinh(dblX) / Cosh(dblX)
End Function

发表评论 评论 (2 个评论)

回复 tmtony 2009-2-14 14:14
呵呵, 抄下了!
回复 rcylbx 2009-2-15 07:25
加点注释吧

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-12-26 23:21 , Processed in 0.072278 second(s), 17 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部