Skip to main content

A Simple Python project to complete the square!

Project description

CompleteTheSquare


A Simple Python project to complete the square!

What is "Completing The Square"

Completing The Square is a method used in Mathematics to easily find the turning point of a quadratic on the graph.
It can also be used to find the roots (where it crosses the x-axis (x-intercept or y=0)), but the quadratic formula is more popular for this. Read this to find out more!


Current version: 1.2 --> Tweaks to code Python version: 3.8


How to use!

  1. Install the module!
pip install CompleteTheSquare
  1. Import the module!
from CompleteTheSquare import CompleteTheSquare as cts

I have imported it as cts to make it easier

  1. Initialise your equation
eq = cts("x²+3x+2")

If you don't want to initialise an equation straight away, simply leave it as ""
4) Complete The Square!

eq.cts()

This will return the completed version (string)! Use print() to print it!
5) Solve!

eq.solve()

This will return the solutions (list)! Use print() to print it!

If you want to initialise the equation outside, do:

eq.equation = "2x²+6x+4"

What do I need to input?

You must input x (lowercase).
You don't need to add the power ², there just needs to be something there.
x£ + 3x + 2 will give the same result as x² + 3x + 2 :P

Contributing

You can open a PR request on Github like I know what that means.

Thanks :P

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CompleteTheSquare-1.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

CompleteTheSquare-1.2-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page