Click here to Skip to main content
Licence CPOL
First Posted 22 Oct 2007
Views 11,238
Downloads 61
Bookmarked 13 times

Complex class - Working with complex numbers

By | 22 Oct 2007 | Article
This class performs operations and evaluates functions with complex numbers. There are different kinds of available functions (log functions, trigonometric functios...). Check it out.

Screenshot - net_complex.jpg

Introduction

This is my first VB.NET project, so don't expect a lot of object orientated principles in this, but I still think this is an excellent class and I'm not sure you can find another class like this one. This class performs operations and evaluates functions with complex numbers. There are a lot of functions (log functions, trigonometric functions...) available. So check it out.

Functions

  • op_Add(ByVal z As Complex) – add z
  • op_Sub(ByVal z As Complex) – sub z
  • op_Mul(ByVal z As Complex) – multiply with z
  • op_Div(ByVal z As Complex) – divide with z
  • f_Sqr() – get square
  • 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() – return angle
  • prop_Abs() – return absolute value
  • ToString() As String – Create string (example 2-5i, or –i, or 8+i)
  • set_FromXY(ByVal mX As Double, ByVal mY As Double) – set real and imaginary from mX and mY
  • set_CopyComplex(ByRef mCplx As Complex) – set real and imaginary from mCplx

Properties

  • Real() As Double
  • Imaginary() As Double

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Ivan0001



Croatia Croatia

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionWhere's the code? Pinmembersherifffruitfly7:09 22 Oct '07  
AnswerRe: Where's the code? PinmemberIvan000123:44 22 Oct '07  
GeneralRe: Where's the code? Pinmembersherifffruitfly19:14 23 Oct '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 22 Oct 2007
Article Copyright 2007 by Ivan0001
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid