|
| 27 Nov 2012 06:47 PM |
| Is there a built in method in Lua for using complex numbers? |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 06:49 PM |
| I don't quite understand what you are looking for. |
|
|
| Report Abuse |
|
|
drgn42
|
  |
| Joined: 11 Feb 2010 |
| Total Posts: 3231 |
|
|
| 27 Nov 2012 07:26 PM |
Complex?
Just thought I'd let you know. |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 07:26 PM |
No, but you could script it :)
@Everyone else Complex numbers are those that deal with the imaginary number 'i'
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]- |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 07:40 PM |
Thanks swim, but that would be a job in itself :D Any yeah, elaborating a tiny bit on what swim said:
The imaginary unit, i (sometimes j) represents the square root of -1. This does not belong to the set of real numbers, since it's, well, impossible to multiply two normal numbers and get a negative number. However, we can express this as a multiple of i;
sqrt(-4) = sqrt(-1)*sqrt(4) = i*4 = 4i
These are quite important in algebra as well as the linking of algebra to trigonometry. For example, Euler's equation states that:
e^(i*pi) = cos(x) + i*sin(x)
Just food for thought :) |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 27 Nov 2012 07:41 PM |
| It's scriptable, but very few languages acutally support them. |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 08:16 PM |
| I hate imaginary Numbers. I want to know a Decimal Version of 'i' [The Square root of -1] |
|
|
| Report Abuse |
|
|
|
| 27 Nov 2012 08:33 PM |
Yes. If you want to make use of *, +, -, /, etc, you could use metatables. Although I think certain operations would still be undefined, for example
5 + i. I am not certain if metatables can properly take in values from the left. |
|
|
| Report Abuse |
|
|