Math
Functions
get_random_angle
Get a random angle.
cli.get_random_angle()
get_points_angle
Get the angle between vector (O, point_1
) and vector (O, point_2
).
Parameters
Variable | Type | Description |
---|---|---|
point_1 | point | Point 1. |
point_2 | point | Point 2. |
Return
Type | Description |
---|---|
number | Angle. |
cli.get_points_angle(point_1, point_2)
create_annular_shape
Annular area.
Parameters
Variable | Type | Description |
---|---|---|
in_radius | number | Inner radius. |
out_radius | number | Outer radius. |
Return
Type | Description |
---|---|
region | Region. |
cli.create_annular_shape(in_radius, out_radius)
create_circular_shape
Circular region.
Parameter
Variable | Type | Description |
---|---|---|
radius | number | Radius. |
Return
Type | Description |
---|---|
region | Region. |
cli.create_circular_shape(radius)
create_rectangle_shape
Rectangle region.
Parameters
Variable | Type | Description |
---|---|---|
width | number | Width. |
length | number | Length. |
angle | number | Angle. |
Return
Type | Description |
---|---|
region | Region. |
cli.create_rectangle_shape(width, length, angle)
create_sector_shape
Sector.
Parameters
Variable | Type | Description |
---|---|---|
radius | number | Radius. |
angle | number | Angle. |
direction | number | Direction. |
Return
Type | Description |
---|---|
region | Region. |
cli.create_sector_shape(radius, angle, direction)
int_to_float
Convert an integer to a real number.
Parameter
Variable | Type | Description |
---|---|---|
value | integer | Integer. |
Return
Type | Description |
---|---|
float | Real number. |
cli.int_to_float(value)
string_to_float
Convert a string to a real number.
Parameter
Variable | Type | Description |
---|---|---|
value | string | String. |
Return
Type | Description |
---|---|
float | Real number. |
cli.string_to_float(value)
random_float_with_min_and_max
Random real number in range.
Parameters
Variable | Type | Description |
---|---|---|
min | number | Smallest real number in the range. |
max | number | Largest real number in the range. |
Return
Type | Description |
---|---|
float | Real number. |
cli.random_float_with_min_and_max(min, max)
get_two_points_distance
Compute the distance between two points.
Parameters
Variable | Type | Description |
---|---|---|
point_1 | point | Point 1. |
point_2 | point | Point 2. |
Return
Type | Description |
---|---|
number | Distance. |
cli.get_two_points_distance(point_1, point_2)
float_plus_one
Real number plus 1.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.float_plus_one(value)
sin
Sine.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.sin(value)
cos
Cosine.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.cos(value)
tan
Tangent.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.tan(value)
asin
Arcsine.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.asin(value)
acos
Arccosine.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.acos(value)
atan
Arctangent.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.atan(value)
sqrt
Square root.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.sqrt(value)
pow
Find the power.
Parameters
Variable | Type | Description |
---|---|---|
value | number | Real number. |
count | integer | Number of times. |
Return
Type | Description |
---|---|
float | Real number. |
cli.pow(value, count)
abs
Find the absolute value.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.abs(value)
log10
Logarithm based on 10.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.log10(value)
log
Value is based on the logarithm of base.
Parameters
Variable | Type | Description |
---|---|---|
value | number | Real number. |
base | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.log(value, base)
round_dec
Result after keeping X decimal places.
Parameters
Variable | Type | Description |
---|---|---|
value | number | Real number. |
position | integer | Position. |
is_round | boolean | Whether to round up or down. |
Return
Type | Description |
---|---|
float | Real number. |
cli.round_dec(value, position, is_round)
get_minor_between_two_float
Get the smaller value between a real number and another real number.
Parameters
Variable | Type | Description |
---|---|---|
one | number | Real number. |
two | number | Real number. |
Return
Type | Description |
---|---|
float | Real number. |
cli.get_minor_between_two_float(one, two)
get_bigger_between_two_float
Get the larger value between a real number and another real number.
Parameters
Variable | Type | Description |
---|---|---|
one | number | Real number. |
two | number | Real number. |
Return
Type | Description |
---|---|
float | Larger of the real numbers. |
cli.get_bigger_between_two_float(one, two)
float_to_int
Convert a float to an integer.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Real number. |
Return
Type | Description |
---|---|
integer | Integer. |
cli.float_to_int(value)
string_to_int
String to integer.
Parameter
Variable | Type | Description |
---|---|---|
value | string | String. |
Return
Type | Description |
---|---|
integer | Integer. |
cli.string_to_int(value)
get_random_int
Random integer in range.
Parameters
Variable | Type | Description |
---|---|---|
min | integer | Integer. |
max | integer | Integer. |
Return
Type | Description |
---|---|
integer | Integer. |
cli.get_random_int(min, max)
get_minor_between_two_int
Get the smaller value between two integers.
Parameters
Variable | Type | Description |
---|---|---|
one | integer | Integer. |
two | integer | Integer. |
Return
Type | Description |
---|---|
integer | Integer. |
cli.get_minor_between_two_int(one, two)
get_bigger_between_two_int
Get the larger value between two integers.
Parameters
Variable | Type | Description |
---|---|---|
one | integer | Integer. |
two | integer | Integer. |
Return
Type | Description |
---|---|
integer | Integer. |
cli.get_bigger_between_two_int(one, two)
int_plus_one
Integer plus 1.
Parameter
Variable | Type | Description |
---|---|---|
value | integer | Integer. |
Return
Type | Description |
---|---|
integer | Integer. |
cli.int_plus_one(value)