rectangles

Using python to find the missing coordinate of a rectangle

Using python to find the missing coordinate of a rectangle Question: Problem: Given integer coordinates of three vertices of a rectangle whose sides are parallel to coordinate axes, find the coordinates of the fourth vertex of the rectangle. I have written the code to answer the problem as follows (but it’s not correct): coord_1_x = …

Total answers: 3

Rotating a rectangle (not image) in pygame

Rotating a rectangle (not image) in pygame Question: In pygame I use pygame.draw.rect(screen, color, rectangle) for all the rectangles in my program. I want to be able to rotate these rectangles to any angle. I have seen the following code to rotate IMAGES but my question is with RECTANGLES. pygame.transform.rotate(image, angle) But I am working …

Total answers: 9