triangle
(
side1
,
side2
,
angle
,
color
)
Creates a triangle given two sides and the angle between them, filled with a color.
The first side extends horizontally to the right. The second side extends from the left endpoint of the first side, rotated counterclockwise by the given angle. This point will be at the bottom left of the graphic, unless the specified angle is more than 90 degrees.
The pinning position is the centroid of the triangle.
side1
length of the first, horizontal side of the triangle
side2
length of the second side of the triangle
angle
angle between the two sides, in degrees
color
the color to be used to fill the triangle
show_graphic(triangle(100, 100, 60, red))
show_graphic(triangle(100, 100, 120, red))
PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI
Privacy Policy • Platform Version ede3c94 (Fri, 23 May 2025 14:43:18 GMT)