Browsing Wiremod's section
← Back to ACE
🔁

Mirrored article

This page is synced automatically from the wiremod/wire GitHub wiki (last synced 1 hour ago). Edits made here will be overwritten on the next sync — contribute on the source wiki instead.

e2 docs vector2

📁 MathUpdated 1 hour ago•0 views
Vector2 = vec2() Same as vec2(0,0) (1 ops) = vec2( X, Y) Makes a 2D vector (2 ops) = vec2( Xy) Makes a 2D vector (2 ops) = vec2( V) Converts a 3D vector into a 2D vector (the z component is dropped) (

Jump to table of contents

Vector2
= vec2()
Same as vec2(0,0) (1 ops)

= vec2( X, Y)
Makes a 2D vector (2 ops)

= vec2( Xy)
Makes a 2D vector (2 ops)

= vec2( V)
Converts a 3D vector into a 2D vector (the z component is dropped) (2 ops)

= vec2( V4)
Converts a 4D vector into a 2D vector (the z and w components are dropped) (2 ops)

= :length()
Gets the length of the vector (3 ops)

= :length2()
Gets the squared length of the vector (3 ops)

= :distance( Other)
Gets the distance between 2D vectors (3 ops)

= :distance2( Other)
Gets the squared distance between 2D vectors (3 ops)

= :normalized()
Gets the normalized vector (3 ops)

= :dot( Other)
Gets the 2D vector dot (scalar) product (3 ops)

= :cross( Other)
Gets the 2D vector cross product/wedge product (3 ops)

= :outerProduct( Other)
Gets the outer product (tensor product) and returns a matrix (tensor) (3 ops)

= :rotate( Rot)
Rotates a vector by the argument (given in degrees) (3 ops)

= positive( Rv1)
Returns a vector containing the positive value of each vector component, equivalent to abs(N) (3 ops)

= toRad( Xv2)
Converts the vector's magnitude from radians to radians (2 ops)

= toDeg( Xv2)
Converts the vector's magnitude from radians to degrees (2 ops)

= clamp( Input, Min, Max)
Returns a vector in the same direction as vector 1, with length clamped between argument 2(min) and argument 3(max) (3 ops)

= :x()
Gets the x component of the vector (1 ops)

= :y()
Gets the y component of the vector (1 ops)

= :setX( X)
Returns a copy of the 2D vector with X replaced (use as Vec2 = Vec2:setX(...)) (1 ops)

= :setY( Y)
Returns a copy of the 2D vector with Y replaced (use as Vec2 = Vec2:setY(...)) (1 ops)

= round( Rv1)
Rounds XY to the nearest integer (4 ops)

= round( Rv1, Decimals)
Rounds XY to argument 2's decimal precision (4 ops)

= ceil( Rv1)
Rounds XY up to the nearest integer (4 ops)

= ceil( Rv1, Decimals)
Rounds XY up to argument 2's decimal precision (4 ops)

= floor( Rv1)
Rounds XY down to the nearest integer (4 ops)

= floor( Rv1, Decimals)
Rounds XY down to argument 2's decimal precision (4 ops)

= min( Rv1, Rv2)
Returns the vector with the smallest length (4 ops)

= max( Rv1, Rv2)
Returns the vector with the greatest length (4 ops)

= maxVec( Rv1, Rv2)
Returns the vector combining the highest value components of V1 and V2 (4 ops)

= minVec( Rv1, Rv2)
Returns a vector combining the lowest value components of V1 and V2 (4 ops)

= mod( Rv1, Rv2)
Returns the remainder after XY have been divided by argument 2 (4 ops)

= mod( Rv1, Rv2)
Returns the remainder after the components of vector 1 have been divided by the components of vector 2 (4 ops)

= clamp( Rv1, Rv2, Rv3)
Clamps vector 1's XY between the XY of vector 2(min) and vector 3(max) (4 ops)

= mix( Vec1, Vec2, Ratio)
Combines vector 1's XY with vector 2's XY by a proportion given by argument 3 (between 0 and 1) (4 ops)

= bezier( Startvec, Control, Endvec, Ratio)
Returns the 2D position on the bezier curve between the starting and ending 2D vector, given by the ratio (value between 0 and 1) (4 ops)

= shift( Rv1)
Swaps the vector's x,y components (2 ops)

= inrange( Rv1, Rv2, Rv3)
Returns 1 if each component of V is between (or is equal to) the components of Vmin and Vmax (2 ops)

= :toAngle()
Returns the 2D angle of the vector (given in degrees, -180 to 180) (2 ops)

= :toString()
Gets the vector nicely formatted as a string "[X,Y]" (5 ops)

= toString( V)
Gets the vector nicely formatted as a string "[X,Y]" (5 ops)

= randvec2()
Returns a uniformly distributed, random, normalized direction vector (5 ops)

= randvec2( Min, Max)
Returns a random vector with its components between N1 and N2 (5 ops)

= randvec2( Min, Max)
Returns a random vector between V1 and V2 (5 ops)

= vec4()
Same as vec4(0,0,0,0) (11 ops)

= vec4( )
Makes a 4D vector (14 ops)

= vec4( , , , )
Makes a 4D vector (14 ops)

= vec4( )
Converts a 2D vector into a 4D vector (the z and w components are set to 0) (14 ops)

= vec4( , , )
Converts a 2D vector into a 4D vector (the z and w components are set to the second and third arguments) (14 ops)

= vec4( , )
Creates a 4D vector from two 2D vectors (14 ops)

= vec4( )
Converts a 3D vector into a 4D vector (the w component is set to 0) (14 ops)

= vec4( , )
Converts a 3D vector into a 4D vector (the w component is set to the second argument) (14 ops)

= :length()
Gets the length of the vector (17 ops)

= :length2()
Gets the squared length of the vector (17 ops)

= :distance( )
Gets the distance between 4D vectors (17 ops)

= :distance2( )
Gets the squared distance between 4D vectors (17 ops)

= :dot( )
Gets the 4D vector dot (scalar) product (17 ops)

= :outerProduct( )
Gets the outer product (tensor product) and returns a matrix (tensor) (25 ops)

= :normalized()
Gets the normalized vector (17 ops)

= :dehomogenized()
Converts a 3D homogeneous vector (x,y,z,w) into a 3D cartesian vector (13 ops)

= positive( )
Returns a vector containing the positive value of each vector component, equivalent to abs(N) (14 ops)

= :x()
Gets the x component of the vector (12 ops)

= :y()
Gets the y component of the vector (12 ops)

= :z()
Gets the z component of the vector (12 ops)

= :w()
Gets the w component of the vector (12 ops)

= :setX( )
Returns a copy of the 4D vector with X replaced (use as Vec4 = Vec4:setX(...)) (13 ops)

= :setY( )
Returns a copy of the 4D vector with Y replaced (use as Vec4 = Vec4:setY(...)) (13 ops)

= :setZ( )
Returns a copy of the 4D vector with Z replaced (use as Vec4 = Vec4:setZ(...)) (13 ops)

= :setW( )
Returns a copy of the 4D vector with W replaced (use as Vec4 = Vec4:setW(...)) (13 ops)

= round( Rv1)
Rounds XYZW to the nearest integer (8 ops)

= round( Rv1, Decimals)
Rounds XYZW to argument 2's decimal precision (8 ops)

= ceil( Rv1)
Rounds XYZW up to the nearest integer (8 ops)

= ceil( Rv1, Decimals)
Rounds XYZW up to argument 2's decimal precision (8 ops)

= floor( Rv1)
Rounds XYZW down to the nearest integer (8 ops)

= floor( Rv1, Decimals)
Rounds XYZW down to argument 2's decimal precision (8 ops)

= min( , )
Returns the vector with the smallest length (23 ops)

= max( , )
Returns the vector with the greatest length (23 ops)

= maxVec( , )
Returns the vector combining the highest value components of V1 and V2 (23 ops)

= minVec( , )
Returns a vector combining the lowest value components of V1 and V2 (23 ops)

= mod( , )
Returns the remainder after XYZW have been divided by argument 2 (23 ops)

= mod( , )
Returns the remainder after the components of vector 1 have been divided by the components of vector 2 (23 ops)

= clamp( , , )
Clamps vector 1's XYZW between the XYZW of vector 2(min) and vector 3(max) (23 ops)

= clamp( Input, Min, Max)
Returns a vector in the same direction as vector 1, with length clamped between argument 2(min) and argument 3(max) (13 ops)

= mix( Vec1, Vec2, Ratio)
Combines vector 1's XYZW with vector 2's XYZW by a proportion given by argument 3 (between 0 and 1) (13 ops)

= shiftR( )
Shifts the vector's components right: shiftR( x,y,z,w ) = ( w,x,y,z ) (14 ops)

= shiftL( )
Shifts the vector's components left: shiftL( x,y,z,w ) = ( y,z,w,x ) (14 ops)

= inrange( , , )
Returns 1 if each component of V is between (or is equal to) the components of Vmin and Vmax (14 ops)

= toRad( Xv4)
Converts the vector's magnitude from radians to radians (5 ops)

= toDeg( Xv4)
Converts the vector's magnitude from radians to degrees (5 ops)

= randvec4()
Returns a uniformly distributed, random, normalized direction vector (7 ops)

= randvec4( Min, Max)
Returns a random vector with its components between N1 and N2 (7 ops)

= randvec4( Min, Max)
Returns a random vector between V1 and V2 (7 ops)

= :toString()
Gets the vector nicely formatted as a string "[X,Y,Z,W]" (7 ops)

= toString( V)
Gets the vector nicely formatted as a string "[X,Y,Z,W]" (7 ops)

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.