Program For Standard Form
def stnfrm(a,b,c):
one = (b/(2.0*a))
two = c-((b**2.0)/(4.0*a))
axis = one/-1.0
x = -b/(2.0*a)
y = a*(x**2.0)+(b*x)+c
print x
if a == 1:
print "(x + %f)**2 + (%f)" % (one,two)
elif a == -1:
print "-(x + %f)**2 + (%d)" % (one,two)
else:
print "%d(x + %f)**2 + (%f)" % (a,one,two)
print "Axis of Symmetry is %f" % (axis)
print "Vertex is (%f,%f)" % (x,y)
if a < 0:
print "Vertex is a Maximum"
else:
print "Vertex is a Minimun"
stnfrm(2.0,-16.0,31.0)
All you need to do is change the numbers in th stnfrm(?,?,?) at the bottom to deteremine the outcomes.
My first piece of code ive fully written.
I would appreciate some input and ideas going forward.