Module guih.lib.algo
Library used for drawing shape and getting points in various shapes.
mostly used for visual things
Functions
get_elipse_points (horizontal_radius, vertical_radius, x, y, filled) | returns all pixels you need to draw an ellipse |
get_triangle_points (p1, p2, p3) | returns all the pixels you need to draw a triangle |
get_triangle_outline_points (p1, p2, p3) | returns all the pixels you need to draw outline of an triangle |
get_line_points (start_x, start_y, end_x, end_y) | returns all pixels you need to draw a line |
Functions
- get_elipse_points (horizontal_radius, vertical_radius, x, y, filled)
-
returns all pixels you need to draw an ellipse
Parameters:
- horizontal_radius number horizontal radius of the ellipse
- vertical_radius number vertical radius of the ellipse
- x number x coordinate of the center of the ellipse
- y number y coordinate of the center of the ellipse
- filled boolean whether the ellipse should be filled or not
Returns:
-
table
a table of all pixels you need to draw the ellipse
- get_triangle_points (p1, p2, p3)
-
returns all the pixels you need to draw a triangle
Parameters:
- p1 vector first point of the triangle
- p2 vector second point of the triangle
- p3 vector third point of the triangle
Returns:
-
table
a table of all pixels you need to draw the triangle
- get_triangle_outline_points (p1, p2, p3)
-
returns all the pixels you need to draw outline of an triangle
Parameters:
- p1 vector first point of the triangle
- p2 vector second point of the triangle
- p3 vector third point of the triangle
Returns:
-
table
a table of all pixels you need to draw the triangle outline
- get_line_points (start_x, start_y, end_x, end_y)
-
returns all pixels you need to draw a line
Parameters:
- start_x number x coordinate of the start of the line
- start_y number y coordinate of the start of the line
- end_x number x coordinate of the end of the line
- end_y number y coordinate of the end of the line
Returns:
-
table
a table of all pixels you need to draw the line