Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pylab
- import random
- import numpy as np
- import math
- def SetXvals(n):
- xSet = np.linspace(-1, 1, n)
- return xSet
- def RamdXvals(n):
- xRand = np.random.randint(-1, 1, n)
- return xRand
- def CalcYvals(xVals):
- y = ((1-xVals ** 2) ** (1/2) + (abs(xVals) ** (1/2)) * (4/5))
- y2 = ((1-xVals ** 2) ** (1/2) + (abs(xVals) ** (1/2)) * (4/5)) * -1
- def Plot(xCoords, myTuple, title):
- fig = pylab.figure()
- plot = fig.add_subplot(111)
- plot.scatter(xx, yy)
- plot.set_title("Plot")
- plot.set_xlabel("X Axis")
- plot.set_ylabel("Y Axis")
- fig.show()
- def main():
- ui = int(input("Enter the number of points you would like to plot: ")))
- return ui
- RamdXvals(ui)
- SetXvals(ui)
- CalcYvals(xSet)
- CalcYvals(xRand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement