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...
assum have a Class enum Suit{ CLUBS , DIAMONDS,SPADES,HEARTS; } Class enum Raml { TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN, JACK,QUEEN,KING,...
assum have a Class enum Suit{ CLUBS , DIAMONDS,SPADES,HEARTS; } Class enum Raml { TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN, JACK,QUEEN,KING, ACE; } public class Card {       private Suit suit;    private Rank rank;    public Card (Rank rank, Suit suit){           this.suit = suit;        this.rank = rank;    }    public Suit getSuit() {        // TODO Auto-generated method stub        return suit;    }    public Rank getRank() {        return rank;    }...
Consider four nonstandard dice, whose sides are labeled as follows (the 6 sides on each die...
Consider four nonstandard dice, whose sides are labeled as follows (the 6 sides on each die are equally likely). A: 4, 4, 4, 4, 0, 0 B: 3, 3, 3, 3, 3, 3 C: 6, 6, 2, 2, 2, 2 D: 5, 5, 5, 1, 1, 1 These four dice are each rolled once. Let A be the result for die A, B be the result for die B, etc. (a) Find P(A > B), P(B > C), P(C >D),...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT