65.9K
CodeProject 正在变化。 阅读更多。
Home

复数类 - 处理复数

starIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIconemptyStarIcon

1.46/5 (6投票s)

2007年10月22日

CPOL

1分钟阅读

viewsIcon

25300

downloadIcon

216

这个类执行复数运算并评估函数。 有各种可用的函数(对数函数、三角函数等)。 请查看它。

Screenshot - net_complex.jpg

引言

这是我的第一个 VB.NET 项目,所以不要期望它包含很多面向对象原则,但我仍然认为这是一个优秀的类,而且我不确定你是否能找到另一个像这样的类。 这个类执行复数运算并评估函数。 有很多函数可用(对数函数、三角函数等)。 所以请查看它。

函数

  • op_Add(ByVal z As Complex) – 添加 z
  • op_Sub(ByVal z As Complex) – 减去 z
  • op_Mul(ByVal z As Complex) – 与 z 相乘
  • op_Div(ByVal z As Complex) – 除以 z
  • f_Sqr() – 获取平方
  • f_Pow(ByVal n As Integer) – (X+Yi)^n
  • f_PowCplx(ByVal z As Complex) - (X+Yi)^z
  • f_Exp() – Exp(X+Yi)
  • f_Conjugate()
  • f_Invert() – (1 / (X+Yi))
  • f_Log(ByVal base As Byte) – Log((X+Yi),base)
  • f_Ln() – Ln(X+Yi)
  • f_Sin() – sin(x+yi)
  • f_Cos() – cos(x+yi)
  • f_ATan() – arctan(x+yi)
  • f_Tan() – tan(x+yi)
  • f_ACot() – acrcot(x+yi)
  • f_ASin() – arcsin(x+yi)
  • f_ACos() – arccos(x+yi)
  • f_Acsc() – arccosec(x+yi)
  • f_Asec() – arcsec (x+yi)
  • prop_Angle() – 返回角度
  • prop_Abs() – 返回绝对值
  • ToString() As String – 创建字符串(例如 2-5i,或 –i,或 8+i)
  • set_FromXY(ByVal mX As Double, ByVal mY As Double) – 从 mXmY 设置实部和虚部
  • set_CopyComplex(ByRef mCplx As Complex) – 从 mCplx 设置实部和虚部

属性

  • Real() As Double
  • Imaginary() As Double
© . All rights reserved.