A structure capable of holding a vector with two dimensions, x and y.
The contents of the <GrapheneVec2> structure are
private and should never be accessed directly.
Adds each component of the two passed vectors and places each result into the components of res.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the result
Allocates a new <GrapheneVec2> structure.
The contents of the returned structure are undefined.
Use vec2:init to initialize the vector.
Returned: a <GrapheneVec2>.
the newly allocated <GrapheneVec2> structure. Use
vec2:free to free the resources allocated by
this function.
Divides each component of the first operand self by the corresponding component of the second operand b, and places the results into the vector res.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the result
Computes the dot product of the two given vectors.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Returned: a real number.
the dot product of the vectors
Checks whether the two given <GrapheneVec2> are
equal.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Returned: a boolean.
true if the two vectors are equal, and false otherwise
Frees the resources allocated by self
Passed: a <GrapheneVec2>.
Retrieves the X component of the <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Returned: a real number.
the value of the X component
Retrieves the Y component of the <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Returned: a real number.
the value of the Y component
Initializes a <GrapheneVec2> using the given values.
This function can be called multiple times.
Passed: a <GrapheneVec2>.
Passed: a real number.
the X field of the vector
Passed: a real number.
the Y field of the vector
Returned: a <GrapheneVec2>.
the initialized vector
Initializes self with the contents of the given array.
Passed: a <GrapheneVec2>.
Passed: a f32vector, or a list or vector, each a real number.
an array of floating point values with at least two elements
Returned: a <GrapheneVec2>.
the initialized vector
Copies the contents of src into self.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Returned: a <GrapheneVec2>.
the initialized vector
Linearly interpolates self and v2 using the given factor.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed: a real number.
the interpolation factor
Passed, filled in, and returned: a <GrapheneVec2>.
the interpolated vector
Computes the length of the given vector.
Passed: a <GrapheneVec2>.
Returned: a real number.
the length of the vector
Compares the two given vectors and places the maximum values of each component into res.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
the resulting vector
Compares the two given vectors and places the minimum values of each component into res.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
the resulting vector
Multiplies each component of the two passed vectors and places each result into the components of res.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the result
Compares the two given <GrapheneVec2> vectors and
checks whether their values are within the given epsilon.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed: a real number.
the threshold between the two vectors
Returned: a boolean.
true if the two vectors are near each other
Negates the given <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the result vector
Computes the normalized vector for the given vector self.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the normalized vector
Retrieves a constant vector with (1, 1) components.
Returned: a <GrapheneVec2>.
the one vector
Multiplies all components of the given vector with the given scalar factor.
Passed: a <GrapheneVec2>.
Passed: a real number.
the scalar factor
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the result vector
Subtracts from each component of the first operand self the corresponding component of the second operand b and places each result into the components of res.
Passed: a <GrapheneVec2>.
Passed: a <GrapheneVec2>.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the result
Stores the components of self into an array.
Passed: a <GrapheneVec2>.
Passed: a f32vector, or a list or vector, each a real number. It is filled in, and returned: a f32vector.
return location for an array of floating point values with at least 2 elements
Retrieves a constant vector with (1, 0) components.
Returned: a <GrapheneVec2>.
the X axis vector
Retrieves a constant vector with (0, 1) components.
Returned: a <GrapheneVec2>.
the Y axis vector
Retrieves a constant vector with (0, 0) components.
Returned: a <GrapheneVec2>.
the zero vector