At My Fingertips

Documentation

Documentation

Function from library pytamaro

triangle(side1side2anglecolor)

triangleside1side2anglecolor

Creates a triangle specifying two sides and the angle between them, filled with a color. The first side extends horizontally to the right. The angle specifies how much the second side is rotated, counterclockwise, from the first one.

For all triangles, except obtuse ones, the bottom-left corner of the resulting graphic concides with the vertex of the triangle for which the angle is specified.

The pinning position is the centroid of the triangle.

side1length of the first, horizontal side of the triangle

side2length of the second side of the triangle

angleangle between the two sides, in degrees

colorthe color to be used to fill the triangle

The specified triangle as a graphic
Code
show_graphic(triangle(100, 100, 60, red))
Output
Graphical output from execution result
Code
show_graphic(triangle(100, 100, 120, red))
Output
Graphical output from execution result

Logo of PyTamaro

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy PolicyPlatform Version 0d7866a (Fri, 20 Dec 2024 07:46:38 GMT)