| | |
Creating Amplitude in C++.net
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 5
Reputation:
Solved Threads: 0
Hi!
I am new to this, and new to the programming. To be honest, it's not easy.
I am having this problem with doing Complex numbers. Basically, I have to write a program to show the Amplitude and Phase of a Complex object. First, because Amplitudes are usually absolute values, how do you write a absolute value equation in C++.net? Also, how do you show the phase?
Also, if anyone out there is a college student, or was a college student, maybe there is a better way to absorb this material. I read the book, but it tends to be too technical to understand. Anyone got any suggestions?
I am new to this, and new to the programming. To be honest, it's not easy.
I am having this problem with doing Complex numbers. Basically, I have to write a program to show the Amplitude and Phase of a Complex object. First, because Amplitudes are usually absolute values, how do you write a absolute value equation in C++.net? Also, how do you show the phase?
Also, if anyone out there is a college student, or was a college student, maybe there is a better way to absorb this material. I read the book, but it tends to be too technical to understand. Anyone got any suggestions?
From what I've read on Wikipedia, it looks like you want the magnitude and the argument of a complex number. Suppose the real part is stored in re and the imaginary part is stored in im (both doubles, presumably). Then
Amplitude is the absolute value in the sense that it is the distance of the complex number from the origin.
What book is this?
C++ Syntax (Toggle Plain Text)
double amplitude = sqrt( re * re + im * im); double phase = atan2( re, im);
Amplitude is the absolute value in the sense that it is the distance of the complex number from the origin.
What book is this?
If you are coding in c++, The standard library provides a template class for complex numbers.
C++ Syntax (Toggle Plain Text)
#include <complex> ... complex<double> z1( 2.7, 3.4); double phase=arg(z1); double magnitude=abs(z1);
•
•
Join Date: Jul 2005
Posts: 5
Reputation:
Solved Threads: 0
Amplitude is the absolute value in the sense that it is the distance of the complex number from the origin.
What book is this?[/QUOTE]
The book we are using in class is called Visual C++.net by DEITEL. I think the book is ok, but it is hard to understand, maybe considering that I am not a programmer. Thanks for the assistance!!!
What book is this?[/QUOTE]
The book we are using in class is called Visual C++.net by DEITEL. I think the book is ok, but it is hard to understand, maybe considering that I am not a programmer. Thanks for the assistance!!!
![]() |
Similar Threads
- Error creating new ASP.Net project (ASP.NET)
Other Threads in the C++ Forum
- Previous Thread: Errors with membering functions in a class
- Next Thread: Again please someone check my code
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






