Question

In: Computer Science

PYTHON: A rhombus is a parallelogram with four equal sides. It resembles the diamonds suit in...

PYTHON:

A rhombus is a parallelogram with four equal sides. It resembles the diamonds suit in

playing cards. Here are the properties of a rhombus:

- opposite sides are parallel
- all four sides have the same length
- opposite angles are equal
- sum of any 2 adjacent angles is 180 degrees (x + y = 180 degrees)

Write a function called rhombus that uses turtle graphics to draw a rhombus.
The function rhombus takes three parameters
:

1. t, a turtle that is used to draw the rhombus. The turtle t may initially be at any location on the
screen and in any orientation and may be either up or down.
2. side, an integer that is the length of a side of the rhombus.
3. acuteAngle, the smaller of the two angles x and y.

The function rhombus should:

1. draw a rhombus, beginning at the initial position and orientation of t
2. leave t in its initial position and orientation when it returns
For full credit, you must perform repeated operations using a loop.

For example, the following is an example of correct graphical output:

import turtle
snappy = turtle.Turtle()
rhombus(snappy, 100, 45)

Solutions

Expert Solution


Related Solutions

Consider a rhombus that is not square (i.e., the four sides all have the same length, but the angles between sides is not 90°).
Consider a rhombus that is not square (i.e., the four sides all have the same length, but the angles between sides is not 90°). Describe all the symmetries of the rhombus. Write down the Cayley table for the group of symmetries,
All of the sides of a quadrilateral are congruent if it is a rhombus.
The following conditional statement is true.All of the sides of a quadrilateral are congruent if it is a rhombus.Which of the following statements must also be true?a) If not all of the sides of a quadrilateral are congruent, then it is not a rhombus.b) If a quadrilateral is not a rhombus, then all of its sides are not congruent.c) If a quadrilateral is a rhombus, then not all of its sides are congruent.d) If all of the sides of a...
In Euclidean geometry, a rhombus is a simple quadrilateral whose four sides all have the same...
In Euclidean geometry, a rhombus is a simple quadrilateral whose four sides all have the same length. If lengths of each of the sides are a and the distance between the parallel sides (known as height) is h, then the area of the rhombus is defined as a × h. Suppose that you already have a class named Rhombus that can hold a and h. The class has a method to compute the area as well. The class is as...
Prove that the quadrilateral enclosed by the perpendicular bisectors of the sides of a rhombus is...
Prove that the quadrilateral enclosed by the perpendicular bisectors of the sides of a rhombus is a rhombus.
please explain your choice. A rhombus is NOT a 1. polygon 2. parallelogram 3. trapezoid 4....
please explain your choice. A rhombus is NOT a 1. polygon 2. parallelogram 3. trapezoid 4. quadrilateral
A parallelogram has consecutive sides with lengths 9 and 7 and diagonals of integral length How...
A parallelogram has consecutive sides with lengths 9 and 7 and diagonals of integral length How long are these diagonals?
Two diagonals of a rhombus are equal. Is it a square? Justify your answer.
Two diagonals of a rhombus are equal. Is it a square? Justify your answer.
2. A standard 52-card deck consists of 4 suits (hearts, diamonds, clubs, and spades). Each suit...
2. A standard 52-card deck consists of 4 suits (hearts, diamonds, clubs, and spades). Each suit has 13 cards: 10 are pip cards (numbered 1, or ace, 2 through 10) and 3 are face cards (jack, queen, and king). You randomly draw a card then place it back. If it is a pip card, you keep the deck as is. If it is a face card, you eliminate all the pip cards. Then, you draw a new card. What is...
(PYTHON) Write aprogram that prompts user to enter three sides of a triangle....
(PYTHON) Write a program that prompts user to enter three sides of a triangle. The program should determine if the three sides can form a triangle. If the three sides can form a triangle, then determine the type of the triangle.There are three types of triangles: Equilateral triangle (all 3 sides are equal) Isosceles triangle (two sides are equal, the third side is of a different length) Scalene triangle (all 3 sides are of different lengths)   The program should...
IN PYTHON- Problem: Roll a ball and make it bounce around the sides of a window...
IN PYTHON- Problem: Roll a ball and make it bounce around the sides of a window 4 times Details: You need to design, write, and test a program that rolls a ball as demonstrated at the beginning of the lab. The ball goes down and right, bounces against the right edge of the window, then goes down and left, bounces against the bottom edge, then goes up and left, bounces against the left edge, then goes up and right, and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT