array_new(_size, _initial_vector) Prototype to initialize a array of vectors. Parameters:
_size: size of the array.
_initial_vector: vector to be used as default value, in the form of array [x, y].
Returns: _vector_array complex Array in the form of a array [0:x, 1:y, 2:x, 3:y,...]
array_size(_id) number of [x, y] vector elements in array. Parameters:
_id: ID of the array.
Returns: int
array_get(_id, _index) Get the vector in a array, in the form of a array [x, y] Parameters:
_id: ID of the array.
_index: Index of the vector.
Returns: vector in the form of a array [x, y]
array_set(_id, _index, _a) Sets the values vector in a array. Parameters:
_id: ID of the array.
_index: Index of the vector.
_a: vector, in the form [x, y].
Returns: Void, updates array _id.
array_push(_id, _a) inserts the vector at the end of array. Parameters:
_id: ID of the array.
_a: vector, in the form [x, y].
Returns: Void, updates array _id.
array_unshift(_id, _a) inserts the vector at the begining of array. Parameters:
_id: ID of the array.
_a: vector, in the form [x, y].
Returns: Void, updates array _id.
array_pop(_id, _a) removes the last vector of array and returns it. Parameters:
_id: ID of the array.
_a: vector, in the form [x, y].
Returns: vector2, updates array _id.
array_shift(_id, _a) removes the first vector of array and returns it. Parameters:
_id: ID of the array.
_a: vector, in the form [x, y].
Returns: vector2, updates array _id.
array_sum(_id) Total sum of all vectors. Parameters:
_id: ID of the array.
Returns: vector in the form of a array [x, y]
array_center(_id) Finds the vector center of the array. Parameters:
_id: ID of the array.
Returns: vector in the form of a array [x, y]
array_rotate_points(_id) Rotate Array vectors around origin vector by a angle. Parameters:
_id: ID of the array.
Returns: rotated points array.
array_scale_points(_id) Scale Array vectors based on a origin vector perspective. Parameters:
_id: ID of the array.
Returns: rotated points array.
array_tostring(_id, _separator) Reads a array of vectors into a string, of the form "[ (x, y), ... ]"" Parameters:
_id: ID of the array.
_separator: string separator for cell splitting.
Returns: string Translated complex array into string.
line_new(_a, _b) 2 vector line in the form. [a.x, a.y, b.x, b.y] Parameters:
_a: vector, in the form [x, y].
_b: vector, in the form [x, y].
Returns:
line_get_a(_line) Start vector of a line. Parameters:
_line: vector4, in the form [a.x, a.y, b.x, b.y].
Returns: float[x, y] vector2
line_get_b(_line) End vector of a line. Parameters:
_line: vector4, in the form [a.x, a.y, b.x, b.y].
Returns: float[x, y] vector2
line_intersect(_line1, _line2) Find the intersection vector of 2 lines. Parameters:
_line1: line of 2 vectors in the form of a array [ax, ay, bx, by].
_line2: line of 2 vectors in the form of a array [ax, ay, bx, by].
Returns: vector in the form of a array [x, y].
draw_line(_line, _xloc, _extend, _color, _style, _width) Draws a line using line prototype. Parameters:
_line: vector4, in the form [a.x, a.y, b.x, b.y].
_xloc: string
_extend: string
_color: color
_style: string
_width: int
Returns: draw line object
draw_triangle(_v1, _v2, _v3, _xloc, _color, _style, _width) Draws a triangle using line prototype. Parameters:
_v1: vector4, in the form [a.x, a.y, b.x, b.y].
_v2: vector4, in the form [a.x, a.y, b.x, b.y].
_v3: vector4, in the form [a.x, a.y, b.x, b.y].
_xloc: string
_color: color
_style: string
_width: int
Returns: tuple with 3 line objects. [line, line, line]
draw_rect(_v1, _size, _angle, _xloc, _color, _style, _width) Draws a square using vector2 line prototype. Parameters:
_v1: vector4, in the form [a.x, a.y, b.x, b.y].
_size: float[x, y]
_angle: float
_xloc: string
_color: color
_style: string
_width: int
Returns: tuple with 3 line objects. [line, line, line]
リリースノート
v2 changed label to console for displaying examples.
Added: perpendicular_distance(_a, _b, _c) Distance from point _a to line between _b and _c. Parameters: _a: vector in the form of a array [x, y]. _b: vector in the form of a array [x, y]. _c: vector in the form of a array [x, y]. Returns: float