Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,550 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,557 people online right now. Registration is fast and FREE... Join Now!




complex numbers

 
Reply to this topicStart new topic

complex numbers

meceng
24 Nov, 2007 - 08:52 AM
Post #1

New D.I.C Head
*

Joined: 24 Nov, 2007
Posts: 2


My Contributions
please can you inform me the code in c++ to solve the polynomial equation ax^2+bx+c including its complex roots,also anither question if we have complex values (a+bi)and (c+di) we want to print out results for folloeing operation 1)summation 2)subtraction 3)mulipliction 4)division thanks
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Complex Numbers
24 Nov, 2007 - 09:23 AM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,868



Thanked: 53 times
Dream Kudos: 550
My Contributions
Please read the forum rules. No one here will do your homework for you. You must show some effort.

the first thing you need to work on is finding a way of representing complex numbers. I usually do that with a struct. Once you have that, the 4 operations are defined in any number of mathematics text-books or the internet. Once you have the 4 operations set up, you can use the quadratic formula to solve the polynomial equation ax^2+bx+c = 0, or use the operations to evaluate the polynomial expression ax^2+bx+c.

Just a pedantic note: ax^2+bx+c is not a polynomial equation. It is a polynomial expression, to be an equation it must contain an equals sign.

ax^2+bx+c = 0 is an equation (and probably the one you mean).
ax^2+bx+c is an expression -- and can not be solved, it may be evaluated (which might be what you mean by "solved").
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 09:44PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month