Click here to Skip to main content
11,482,402 members (72,821 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
How I can present J into C++ programe for this equation
Z=R*(X_l+X_c )j
j wich is mean the imaginary part ( complex number )
Posted 9-Apr-13 6:15am
Edited 9-Apr-13 6:17am
v2
Comments
Sergey Alexandrovich Kryukov at 9-Apr-13 11:21am
   
What do you mean by "present"? Just using the arithmetic of complex numbers, or some "fancy" presentation on screen?
Traditionally, imaginary part is indicated by imaginary unit denoted "i", not "j"...
—SA
OriginalGriff at 9-Apr-13 11:26am
   
Not necessarily: "In the disciplines of electrical engineering and control systems engineering, the imaginary unit is often denoted by j instead of i, because i is commonly used to denote electric current in these disciplines."
Wiki: http://en.wikipedia.org/wiki/Imaginary_unit
It may be the OP is from an engineering background.
Sergey Alexandrovich Kryukov at 9-Apr-13 11:28am
   
I don't say necessarily, of course...
—SA
OriginalGriff at 9-Apr-13 11:38am
   
:)
Sergey Alexandrovich Kryukov at 9-Apr-13 13:39pm
   
Please stop posting non-answers as "solution". It can give you abuse reports which eventually may lead to cancellation of your CodeProject membership.
Comment on any posts, reply to available comments, or use "Improve question" (above).
Also, keep in mind that members only get notifications on the post sent in reply to there posts.
—SA
Matt T Heffron at 9-Apr-13 13:40pm
   
You can't represent complex numbers with the notation you've shown.
Just like you need the * to represent multiplication (e.g., instead of "3b" for "3 times b", you must use "3*b"), you will need a different notation for complex numbers.
The link that Richard provided (Solution 1) has the documentation of a standard implementation for complex numbers in c++.
This is what you'll need to use.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You could easily do this[^].
  Permalink  
Comments
CPallini at 9-Apr-13 13:43pm
   
5.

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



Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 9 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100