|
| 27 Feb 2013 05:18 PM |
We all know that numbers in Lua can not be complex, they can be real. Here is an example of how to make complex numbers, and actually use them in functions, using Vector2 values.
local c = Vector2.new(1,1) -- Complex number; the X coordinate is the real value, the Y coordinate is the imaginary coordinate.
function printNum(x) print(x.X.." + "..x.Y.."i") end
function ln(x) -- Natural Logarithm local real = math.log(x.X^2 + x.Y^2) / 2 local imaginary = math.acos(x.X/(x.X^2 + x.Y^2)^0.5) return Vector2.new(real,imaginary) end
printNum(ln(c))
-- Output: -- 0.3465735912323 + 0.78539818525314i |
|
|
| Report Abuse |
|
|
NVI
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 4744 |
|
| |
|
| |
|
|
| 27 Feb 2013 06:32 PM |
@Prehistoricman,
What exactly are you implying? |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2013 06:34 PM |
Normally the saying goes "cool story bro, tell it again" The rest is self-explanatory. I wasn't really implying anything. |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2013 06:34 PM |
He was adding onto NVI's post to make one message: "cool story bro script it again" |
|
|
| Report Abuse |
|
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
|
| 27 Feb 2013 08:40 PM |
| You never followed Prehistoric's command. |
|
|
| Report Abuse |
|
|
Vrakner
|
  |
| Joined: 19 Feb 2013 |
| Total Posts: 323 |
|
|
| 28 Feb 2013 11:23 AM |
| And that's what makes him that [Content Deleted] good. |
|
|
| Report Abuse |
|
|
mew903
|
  |
| Joined: 03 Aug 2008 |
| Total Posts: 22071 |
|
|
| 28 Feb 2013 05:57 PM |
Can't be sure if these will help, but they look promising.
http://www.roblox.com/Complex-Numbers-item?id=54477193 http://www.roblox.com/Complex-Number-class-item?id=13926909 |
|
|
| Report Abuse |
|
|