Types/vector: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Created page with "=Vector= Table of x and y eg. vector = {0, 12}")
 
(I think it's fine to duplicate this here, it's unlikely to change)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Vector=
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.


Table of x and y
Example:
vector = {0, 12}


eg.
Example:
    vector = {0, 12}
 
right = {1.0, 0.5}
 
== See also ==
 
* http://lua-api.factorio.com/latest/Concepts.html#Vector

Latest revision as of 15:34, 17 June 2022

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