|
-
Sep 30th, 2001, 11:05 AM
#1
Thread Starter
Member
Sqrt of -1
Is this possible in VB?
I know how to work with complex numbers (adding, subtraction, division, multiply) in borland c++, but in vb?
-
Sep 30th, 2001, 11:13 AM
#2
You have to represent complex numbers with a UDT like
Code:
Type Complex
r as Single
imag as Single
End Type
Dim Im as Complex
Then you have to do all the math in functions that you write yourself.
Code:
Function ComplexAdd(a as Complex,b as Complex) as Complex
Dim tmp as Complex
tmp.r = a.r + b.r
tmp.imag = a.imag + b.imag
ComplexAdd = tmp
End Function
-
Sep 30th, 2001, 11:17 AM
#3
Thread Starter
Member
thnx men, it look alot like C++. I thought it was more difficult then that!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|