Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Vector2: Difference between revisions

From FiguraMC
Redirected page to Vectors and Matrices
Tag: New redirect
 
PenguinEncounter (talk | contribs)
Add Vector2-specific methods
Tags: Removed redirect 2017 source edit
Line 1: Line 1:
#REDIRECT [[Vectors and Matrices]]
{{Hatnote|For general information on vectors, see [[Vector]] and [[Vectors and Matrices]].}}
 
A '''Vector2''' is a [[vector]] that contains 2 numbers.
 
== Methods ==
{| class="wikitable"
! Method !! Brief description
{{:Vector/MethodIndex|T=Vector2|M=Matrix2|Size=2}}
|-
| [[#augmented|augmented]] || Convert this vector into a {{type|Vector3}} by appending a number.
|}
 
== Fields ==
{| class="wikitable"
! Field !! Brief description
|-
| [[#field_x|x]], [[#field_r|r]], <code>[1]</code> || First component.
|-
| [[#field_y|y]], [[#field_g|g]], <code>[2]</code> || Second component.
|}
 
== Operators ==
{| class="wikitable"
! Operator !! Brief description
{{:Vector/OperatorIndex|T=Vector2|M=Matrix2|Size=2}}
|}
 
== Methods ==
{{:Vector/Methods|T=Vector2|M=Matrix2|Size=2}}
 
=== Vector2 methods ===
==== augmented ====
----
 
Converts this Vector2 into a {{type|Vector3}} using the provided number as the third component.
 
{| class="wikitable"
! Arguments !! Return Type
|-
| <code>augmented({{type|number}} d)</code>
| {{type|Vector3}}
|}
 
== Fields ==
{{:Vector/Fields|T=Vector2|M=Matrix2|Size=2}}
 
=== Vector2 fields ===
==== x, r, 1 <span id="field_x"></span><span id="field_r"></span> ====
----
Read/write {{type|number}}. The first component of the vector.
 
==== y, g, 2 <span id="field_y"></span><span id="field_g"></span> ====
----
Read/write {{type|number}}. The second component of the vector.
 
== Operators ==
{{:Vector/Operators|T=Vector2|M=Matrix2|Size=2}}

Revision as of 04:34, 29 October 2024

For general information on vectors, see Vector and Vectors and Matrices.

A Vector2 is a vector that contains 2 numbers.

Methods

Method Brief description

Vector/MethodIndex

augmented Convert this vector into a Vector3 by appending a number.

Fields

Field Brief description
x, r, [1] First component.
y, g, [2] Second component.

Operators

Operator Brief description

Vector/OperatorIndex

Methods

Vector/Methods

Vector2 methods

augmented


Converts this Vector2 into a Vector3 using the provided number as the third component.

Arguments Return Type
augmented(number d) Vector3

Fields

Vector/Fields

Vector2 fields

x, r, 1


Read/write number. The first component of the vector.

y, g, 2


Read/write number. The second component of the vector.

Operators

Vector/Operators