Ask Question
1 January, 08:32

Two polygons are said to be similar if their corresponding angles are the same or if each pair of corresponding sides has the same ratio. Write the code to test if two rectangles are similar when the length and width of each are provided as integer values. For example:If the rectangles have lengths of 10 and 8, the ratio would be 1.25.

+5
Answers (1)
  1. 1 January, 08:39
    0
    Let's do this in Python. We will assume there are 4 user inputs. L1, W1 are the length and width of the first rectangle, respectively. L2, and W2 are the length and width of the 2nd rectangle. We can check if they are similar by comparing their ratios.

    def check_similar (L1, W1, L2, W2):

    if L1/L2 = = W2/W2:

    return True

    else:

    return False
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Two polygons are said to be similar if their corresponding angles are the same or if each pair of corresponding sides has the same ratio. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers