Math: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: Lua has buildin math functions, that you can use in scripts. <syntaxhighlight lang="lua"> math.abs math.acos math.asin math.atan math.atan2 math.ceil math.cos math.cosh math.deg math.exp...)
 
No edit summary
Line 1: Line 1:
Lua has buildin math functions, that you can use in scripts.
Math is a built-in Lua library which containts mathematical functions and constants that you can use in scripts.


<syntaxhighlight lang="lua">
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.abs math.abs]
math.abs  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.acos math.acos]
math.acos  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.asin math.asin]
math.asin
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.atan math.atan]
math.atan  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.atan2 math.atan2]
math.atan2  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.ceil math.ceil]
math.ceil
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.cos math.cos
math.cos  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.cosh math.cosh]
math.cosh
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.deg math.deg]
math.deg  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.exp math.exp]
math.exp  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.floor math.floor]
math.floor  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.fmod math.fmod]
math.fmod
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.frexp math.frexp]
math.frexp  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.huge math.huge] (constant)
math.huge
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.ldexp math.ldexp]
math.ldexp  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.log math.log]
math.log
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.log10 math.log10]
math.log10  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.max math.max]
math.max
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.min math.min]
math.min  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.modf math.modf]
math.modf
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.pi math.pi] (constant)
math.pi  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.pow math.pow]
math.pow
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.rad math.rad]
math.rad  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.random math.random]
math.random
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.randomseed math.randomseed]
math.randomseed      
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.sin math.sin]
math.sin  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.sinh math.sinh]
math.sinh  
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.sqrt math.sqrt]
math.sqrt
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.tanh math.tanh]
math.tanh
* [http://www.lua.org/manual/5.2/manual.html#pdf-math.tan math.tan]
math.tan
</syntaxhighlight>


==See Also==
==See Also==
*[http://lua-users.org/wiki/MathLibraryTutorial Math examples on the LUA Wiki]
* [http://lua-users.org/wiki/MathLibraryTutorial Math examples on the LUA Wiki]
 
[[Category:Scripting Concepts]]
[[Category:Scripting Concepts]]

Revision as of 18:18, 10 April 2012