-
-
Save anthonymorast/19e886d9a13117e62141137f0b222b5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_equation(self): | |
eqn_string = "" | |
for i in range(self.order + 1): | |
if self.coefficients[i] != 0: | |
eqn_string += str(self.coefficients[i]) + ("(x-{})^{}".format(self.center, i) if i > 0 else "") + " + " | |
eqn_string = eqn_string[:-3] if eqn_string.endswith(" + ") else eqn_string | |
print(eqn_string) | |
def print_coefficients(self): | |
print(self.coefficients) | |
def get_coefficients(self): | |
""" | |
Returns the coefficients of the taylor series | |
""" | |
return self.coefficients |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment