# Python

Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last
• August 5th, 2011, 04:54 AM
IcSilk
Python
Ok, through a vodka induced 'slowness' I've decided this was the proper spot for this question.
I've started to learn PYTHON, at a very beginner stage, this is a completely self taught effort and I will be coming here alot for questions.

this is where I am:
Quote:

Complex numbers are always represented as two floating point numbers, the real and imaginary part. To extract these parts from a complex number z, use z.real and z.imag.
>>> a=1.5+0.5j
>>> a.real
1.5
>>> a.imag
0.5
and I have to admit, Im so befuddled by this that Im not even sure of my exact question
Really what I need is a complete breakdown of this whole component, if anyone is up for it.
the .real command (is it considered a command or something else?) and the .imag 'command'.

Any and all input is welcome here, as one's two cents might make perfect sense, and anothers
might make just as much sense but the two together might make a
revelation.

And WTF is meant by 'floating point numbers'?

thanx all

Blessings
F
• August 5th, 2011, 02:58 PM
metguru
.real isn't really considered a command. More of an attribute of the variable that it is used with. When typing in a.real, python (which is a scripting language) outputs the real part of the number a.

Do you have a full conceptual understanding of the imaginary number system?

A floating point variable is one that contains a decimal point that can be anywhere within the variable, hence 'float'. They are usually 4 bytes of resolution, however different languages are different with variable sizes, so that's more of a reference to the classic C/C++ style. However even if your variable is more or less than 4 bytes, it is possible that it still only has 4 bytes of resolution (ie: Java; however in this case, variable are not actually variables and are treated as objects, so they'll take up much more than the 4 bytes of space).
• August 8th, 2011, 01:52 PM
SirDice
Quote:

Originally Posted by IcSilk
Really what I need is a complete breakdown of this whole component, if anyone is up for it.
the .real command (is it considered a command or something else?) and the .imag 'command'.

You first need to know what complex numbers are.

The basis is that j = sqrt ( -1 ) and j^2 = -1

http://en.wikipedia.org/wiki/Complex_numbers
• August 12th, 2011, 10:32 PM
IcSilk
Quote:

You first need to know what complex numbers are.
lmao. yeah you're right..............got a looooong way to go :rolleyes::rolleyes:
• August 14th, 2011, 04:05 AM
IcSilk
OK, Im ready and willing to admit I have some studying to attend to:

Quote:

Complex numbers are also supported; imaginary numbers are written with a suffix of j or J. Complex numbers with a nonzero real component are written as (real+imagj), or can be created with the complex(real, imag) function.
>>> 1j * 1J (-1+0j) >>> 1j * complex(0,1) (-1+0j) >>> 3+1j*3 (3+3j) >>> (3+1j)*3 (9+3j) >>> (1+2j)/(1+1j) (1.5+0.5j)

:confused: Where do I start?? 'j'/'J' as an imaginary number is not a mathematical variable?

Wow, I really need to go back and study number theory/algebra. Im astounded this makes so little sense to me right now. :cry::cry:

I did just get off your wiki link, sir dice, and my mind is just completely rejecting it all right now. Maybe I just gotta try again tomorrow.
That wiki link isn't quite the novice level breakdown that I think I need though. DAMN I FEEL DUMB RIGHT NOW
• August 14th, 2011, 04:23 AM
bludgeon

http://diveintopython.org/getting_to...tionaries.html

scripting/programming is only easy because it's a completely man made thing that every person has agreed upon the concept of "this does this in my language"...once again, more personal information is needed to asses skill level...the hard part is all that time reading boring details. :D just guessing.
• August 14th, 2011, 05:38 AM
IcSilk
Good site, thanks.

Quote:

...the hard part is all that time reading boring details. :D just guessing.
lmao, good guess! that type of reading is where my mind starts dumbing down.
• August 14th, 2011, 07:41 PM
metguru
Does this make things any easier? http://simple.wikipedia.org/wiki/Complex_number
Wikipedia has simplified articles under Simplified English. Sometimes makes technical articles easier to understand. ;)
• August 14th, 2011, 09:05 PM
IcSilk
^ Yes, thank you. I didn't have the time to read it all the way through right now but the skimming of it I did makes much more sense ....

stayed tuned :p
• August 16th, 2011, 07:39 AM
SirDice
Yes, the basic idea is that i (or j) is a number, not a variable. It's a bit of a mathematical construct to help solve certain problems.

It resolves around the rule that any number (positive or negative) multiplied by itself gives a positive result. To 'break' that rule they've come up with i. If you multiply i with itself the result is negative. Something that isn't possible with the 'old' rules.

Complex numbers make certain mathematical problems easier to solve.
Show 40 post(s) from this thread on one page
Page 1 of 2 12 Last