Question

In: Computer Science

The shape of a limacon can be defined parametrically as                                  

The shape of a limacon can be defined parametrically as

                                   r = r0 + cos θ,

                                   x = r cos θ,

                                   y = r sin θ.

When r0 = 1, this curve is called a cardioid. Use this definition to plot the shape of a limacon for r0 = 0.8, r0 = 1.0, and r0 = 1.2. Be sure to use enough points that the curve is closed and appears smooth (except for the cusp in the cardioid). Use a legend to identify which curve is which. This is python programming

Solutions

Expert Solution

import matplotlib.pyplot as plt
import math
from matplotlib.pyplot import figure
#Set figure size
figure(num=None, figsize=(5,10))
r_values = [0.8, 1.0, 1.2]
#We will create subplots in 3x1 arrangement
for j in range(1,4):
    ax = plt.subplot(3,1, j)     #3,1,j means 3rd row, 1st column, jth subplot
    #Set title for jth subplot
    ax.set_title(str(r_values[j-1]))
    x = []        #Empty lists that will store values of x and y
    y = []
    #Generating x and y values according to r and theta as given in equation
    for theta in range(0,360):
        r = r_values[j-1] + math.cos(theta)
        x.append(r*math.cos(theta))
        y.append(r*math.sin(theta))
        #Plot x,y points
        plt.scatter(x, y, color='r')
       


Related Solutions

How can cultural differences shape the perception about gentrification?
How can cultural differences shape the perception about gentrification?
A peanut can has the usual “can shape” of a circular cylinder. Its sides are made...
A peanut can has the usual “can shape” of a circular cylinder. Its sides are made of cardboard, its bottom is made of thick plastic-coated aluminum foil, and its top lid is made of clear plastic. It must have a volume of 480 cubic centimeters. The cardboard material used for the sides costs 0.1 cents per square centimeter, the foil material used for the bottom costs 0.3 cents per square centimeter, and the plastic material used for the top lid...
A peanut can has the usual “can shape” of a circular cylinder. Its sides are made...
A peanut can has the usual “can shape” of a circular cylinder. Its sides are made of cardboard, its bottom is made of thick plastic-coated aluminum foil, and its top lid is made of clear plastic. It must have a volume of 480 cubic centimeters. The cardboard material used for the sides costs 0.1 cents per square centimeter, the foil material used for the bottom costs 0.3 cents per square centimeter, and the plastic material used for the top lid...
The boom of the business cycle can be best defined as:                         a.) the period of...
The boom of the business cycle can be best defined as:                         a.) the period of prosperity of the business cycle.                         b.) the general attempt to expand production and of all prices to rise.                         c.) at least two consecutive quarters of growth in GDP.                         d.) all the immediately above.
Anything that can be used for the payment of goods and services is defined as A)...
Anything that can be used for the payment of goods and services is defined as A) finance. B) commerce. C) money. D) a medium. E) value. Accounting refers to the process of A) recording, measuring, and interpreting financial information. B) producing goods and services. C) forecasting income and expenses for a set period of time. D) moving money through an organization on a daily basis. E) developing promotional plans. Google can use web searches done through its search engine to...
We can experiment with two parallelepipeds (boxes) that are similar in shape. The dimensions of the...
We can experiment with two parallelepipeds (boxes) that are similar in shape. The dimensions of the smaller box are 2 in. x 4 in. x 3 in. The larger box has twice the dimensions of the smaller . Draw and label the large box 1. Surface area (SA) of a box is the sum of the areas of all six sides. Compare the SAs of the two boxes. top or bottom front or back side total surface area Small box...
1. Corporate social responsibility can be defined as a company's obligation to ________.
1. Corporate social responsibility can be defined as a company's obligation to ________.A. blend its activities into the social fabric of whatever country it conducts business inB. include social networking and society events that bring in prominent members of the communityC. conduct its activities with the aim of achieving social, environmental, and economic developmentD. behave in whatever manner is necessary to earn the highest profit for ownersE. be flexible with its ethics in the workplace in order to maintain profitability2. Corporate...
In general, a contingency can be defined as an existing condition or situation that is uncertain,...
In general, a contingency can be defined as an existing condition or situation that is uncertain, where it cannot be known if a loss (and a related liability ) will result from the situation until one or more future events happen or do not happen. There are three different approached that can be taken with contingencies: 1 recorded (or recognized)as a liability. 2 disclosed ( in the notes to the financial statements) and 3 not recorded or disclosed. Scenario Betteries4U...
Impulse control can be defined as an inability to control the desire for a substance or...
Impulse control can be defined as an inability to control the desire for a substance or act. The lack of impulse control is seen as a factor related to substance abuse but it is not the only factor. Research information on addictions and the two types of addictions (substance addictions and behavioral addictions). Choose one substance addiction and one behavioral addiction and answer the following: Describe each addiction including potential genetic and environmental factors leading to the addiction. Describe the...
Can the quality be defined in the superheated vapor or compressed liquid regions?
Can the quality be defined in the superheated vapor or compressed liquid regions?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT