Professional Documents
Culture Documents
Plotting and Classes
Plotting and Classes
pyplot as plt
import math
# f(x) = e^(-|x|) * cos(2 * PI * x)
class Point2D:
def __init__(self, x = 0):
self.x = x
def fX(self, x):
result = 0
result = math.exp(abs(-x)) * math.cos(2*math.pi*x)
return result
graph = []
numPoints = int(input("Please enter the number of points that you would like to
graph with the function given: f(x) = e^(-|x|) * cos(2 * PI * x)"))
count = 0