Introduction
This is a different kind of complex number class for VB.NET than most of the ones I have seen. It is written so that the functions and operators can perform calculations natively by the calling class or method. It is indended to be highly extensible and easy to use.
For example, the arcSin
function looks like this:
Public Function arcSin(ByVal z As Complex) As Complex
Return -i * Ln((i * z) + Sqrt(1 - z ^ 2))
End Function
..and the inverse hyperbolic cosecant looks like this:
Public Function arcCsch(ByVal z As Complex) As Complex
Return Ln(Sqrt(1 + (1 / (z ^ 2))) + 1 / z)
End Function
These are the mathematical equations for complex numbers, and they will work for complex or real numbers. All 24 trigonometric and hyperbolic functions and their inverses are included in the source code.
Also included are operator and function overloads so that equations such as z+2 (mixing complex and real numbers (in this case doubles or integers)) is valid and allowed. Also perfectly valid are equations such as arcSin(2)
, where '2' is a real (Double
) argument but the result is complex because there are no real number solutions for it.
Included is a class which contains the declarations, constructors, and operators, and a module which has all of the math code in it, and finally a Form
class which provides some examples on how to declare and use the methods.