Types/vector: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (more content)
No edit summary
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{stub}}
A vector is a two-element array containing the x and y components. Unlike Positions, vectors don't use the x, y keys. Positive x goes towards east, positive y goes towards south.  
A vector is a two-element array containing the x and y components. Unlike Positions, vectors don't use the x, y keys.


Example:
Example:
Line 7: Line 6:
Example:
Example:


  right = {1.0, 0.0}
  right = {1.0, 0.5}


== See also ==
== See also ==


* http://lua-api.factorio.com/latest/Concepts.html#Vector
* http://lua-api.factorio.com/latest/Concepts.html#Vector

Revision as of 12:47, 16 March 2020

A vector is a two-element array containing the x and y components. Unlike Positions, vectors don't use the x, y keys. Positive x goes towards east, positive y goes towards south.

Example:

vector = {0, 12}

Example:

right = {1.0, 0.5}

See also