Garry's Mod Wiki

Revision Difference

Vector#517253

List of all possible functions to manipulate vectors. Created by <page>Global.Vector</page>. <classfields>⤶ <fields>⤶ <item name="**x** or **1**" type="number">The X component of the vector.</item>⤶ ⤶ <item name="**y** or **2**" type="number">The Y component of the vector.</item>⤶ ⤶ <item name="**z** or **3**" type="number">The Z component of the vector.</item>⤶ </fields>⤶ ⤶ </classfields>⤶ ⤶ ⤶ <example>⤶ ⤶ Type | Name | Description ⤶ ------ | -------------- | ------------------------------ ⤶ <page>number</page> | **x** or **1** | The X component of the vector. ⤶ <page>number</page> | **y** or **2** | The Y component of the vector. ⤶ <page>number</page> | **z** or **3** | The Z component of the vector. ⤶ ⤶ <example>⤶ <description>Indexing by named component.</description> <code> local v = Vector( 1, 2, 3 ) print( v.x, v.y, v.z ) </code> <output>1 2 3</output> </example> <example> <description>Indexing by number (most efficient!).</description> <code> local v = Vector( 1, 2, 3 ) print( v[1], v[2], v[3] ) </code> <output>1 2 3</output> </example>