From 6f3626a013d01493ce6a0f0637dfdb261fe21e83 Mon Sep 17 00:00:00 2001 From: tsb1995 <47466105+tsb1995@users.noreply.github.com> Date: Tue, 10 Dec 2019 17:27:48 -0800 Subject: [PATCH] add working button links --- __pycache__/app.cpython-37.pyc | Bin 377 -> 4613 bytes app.py | 192 +++++++++++++++++++++++++++++++- helpers.py | 61 ++++++++++ requirements.txt | 115 ++++++++++++++++++- templates/QuillDiff.html | 49 ++++++++ templates/apology.html | 9 ++ templates/aprox.html | 34 ++++++ templates/aproxd.html | 60 ++++++++++ templates/differentiated.html | 12 ++ templates/differentiation.html | 28 +++++ templates/differentiation0.html | 28 +++++ templates/index0.html | 15 +++ templates/integrated.html | 12 ++ templates/integration.html | 28 +++++ templates/layout.html | 12 +- templates/layout0.html | 84 ++++++++++++++ templates/login.html | 17 +++ templates/maxmin.html | 31 ++++++ templates/optimized.html | 64 +++++++++++ templates/register.html | 37 ++++++ templates/riemann.html | 42 +++++++ templates/rightSummed.html | 49 ++++++++ templates/summed.html | 49 ++++++++ 23 files changed, 1019 insertions(+), 9 deletions(-) create mode 100644 helpers.py create mode 100644 templates/QuillDiff.html create mode 100644 templates/apology.html create mode 100644 templates/aprox.html create mode 100644 templates/aproxd.html create mode 100644 templates/differentiated.html create mode 100644 templates/differentiation.html create mode 100644 templates/differentiation0.html create mode 100644 templates/index0.html create mode 100644 templates/integrated.html create mode 100644 templates/integration.html create mode 100644 templates/layout0.html create mode 100644 templates/login.html create mode 100644 templates/maxmin.html create mode 100644 templates/optimized.html create mode 100644 templates/register.html create mode 100644 templates/riemann.html create mode 100644 templates/rightSummed.html create mode 100644 templates/summed.html diff --git a/__pycache__/app.cpython-37.pyc b/__pycache__/app.cpython-37.pyc index 71a4213330ce59087ca7cf4ff8510f56fbc7fcd4..d78afc599ae165a5e57ac36031c159bc61f30716 100644 GIT binary patch literal 4613 zcmd5=&2t<_6`!83ot^!(B+IhwgpHF>D1c>LPzhi{%85e)!MIAIOsSL-BXzGd_RP+@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JZCr<`#TvL9EWFunction you would like to Derive:

+

Type math here:

+
+
+ +
+

Your Input Will Appear Here

+ +
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/apology.html b/templates/apology.html new file mode 100644 index 0000000..6003a56 --- /dev/null +++ b/templates/apology.html @@ -0,0 +1,9 @@ +{% extends "layout.html" %} + +{% block title %} + Apology +{% endblock %} + +{% block main %} + {{ top }} +{% endblock %} diff --git a/templates/aprox.html b/templates/aprox.html new file mode 100644 index 0000000..9d62dc5 --- /dev/null +++ b/templates/aprox.html @@ -0,0 +1,34 @@ +{% extends "layout.html" %} + +{% block title %} + Approximation +{% endblock %} + +{% block main %} + Function you would like to Approximate: +
+
+ +
+

Your Input Will Appear Here

+

To create the Linearization of f at a, L(x) = f(a) + f'(a)(x-a), we need an easy to calculate value, a, + and a difficult to find value for x

+
+ + +
+ +
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/aproxd.html b/templates/aproxd.html new file mode 100644 index 0000000..8c8c899 --- /dev/null +++ b/templates/aproxd.html @@ -0,0 +1,60 @@ +{% extends "layout.html" %} + +{% block title %} + Differentiated +{% endblock %} + +{% block main %} +
+

Your function is $f(x) = {{ value }}$

+

Your Linear Approximation of $f(x)$ at $x = {{ h }}$ is ${{ lh }}$

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Step 1Setup L(x)
$L(x) = f({{ a }}) + f'({{ a }})(x-{{ a }})$
Step 2Take the Derivative
$f'(x) = {{ fprime }}$
Step 3Plug in values
$f({{ a }}) = {{ fa }}$
$f'({{ a }}) = {{ fprimea }}$
$L(x) = {{ fa }} + [{{ fprimea }}(x - {{ a }})]$
Step 4Use our $L(x)$ to approximate $f({{ h }})$
$L({{ h }}) = {{ fa }} + [{{ fprimea }}({{ h }} - {{ a }})]$
$= {{ lh }}$
+{% endblock %} \ No newline at end of file diff --git a/templates/differentiated.html b/templates/differentiated.html new file mode 100644 index 0000000..fa6cef2 --- /dev/null +++ b/templates/differentiated.html @@ -0,0 +1,12 @@ +{% extends "layout.html" %} + +{% block title %} + Differentiated +{% endblock %} + +{% block main %} +
+

For $f(x) = {{ value }}$

+

$f'(x) = {{ fprime }}$

+
+{% endblock %} \ No newline at end of file diff --git a/templates/differentiation.html b/templates/differentiation.html new file mode 100644 index 0000000..ebfad20 --- /dev/null +++ b/templates/differentiation.html @@ -0,0 +1,28 @@ +{% extends "layout.html" %} + +{% block title %} + Differentiation +{% endblock %} + +{% block main %} +

Function you would like to Derive:

+
+
+ +
+

Your Input Will Appear Here

+ +
+ + + +{% endblock %} diff --git a/templates/differentiation0.html b/templates/differentiation0.html new file mode 100644 index 0000000..4d26591 --- /dev/null +++ b/templates/differentiation0.html @@ -0,0 +1,28 @@ +{% extends "layout.html" %} + +{% block title %} + Differentiation +{% endblock %} + +{% block main %} +

Function you would like to Derive:

+
+
+ +
+

Your Input Will Appear Here

+ +
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/index0.html b/templates/index0.html new file mode 100644 index 0000000..ea6e207 --- /dev/null +++ b/templates/index0.html @@ -0,0 +1,15 @@ +{% extends "layout.html" %} + +{% block title %} + Index +{% endblock %} + +{% block main %} +

This is a website dedicated to making the lives of calculus students easier, if ever so slightly.

+

All function inputs will be taken assuming 'x' as your variable. All other letters will be treated as constants

+

That noted, you may enter terms for well known constants and they will likely be accounted for

+

As an example you could enter the function $sin(\pi x)$ with the notation sin(pi*x)

+

As a once struggling calculus student, I highly recommend this site be used either to check your work or as a tool + to understand the steps behind those problems which you failed in solving alone

+

Good luck!

+{% endblock %} \ No newline at end of file diff --git a/templates/integrated.html b/templates/integrated.html new file mode 100644 index 0000000..632ab8a --- /dev/null +++ b/templates/integrated.html @@ -0,0 +1,12 @@ +{% extends "layout.html" %} + +{% block title %} + Integrated +{% endblock %} + +{% block main %} +
+

Your Equation is: ${{ value }}$

+

Your integral is: ${{ fintegral }}$

+
+{% endblock %} \ No newline at end of file diff --git a/templates/integration.html b/templates/integration.html new file mode 100644 index 0000000..6c18d83 --- /dev/null +++ b/templates/integration.html @@ -0,0 +1,28 @@ +{% extends "layout.html" %} + +{% block title %} + Integration +{% endblock %} + +{% block main %} +

Function you would like to Integrate:

+
+
+ +
+

Your Input Will Appear Here

+ +
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/layout.html b/templates/layout.html index 84b351f..485f9e2 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -43,7 +43,6 @@ diff --git a/templates/layout0.html b/templates/layout0.html new file mode 100644 index 0000000..84b351f --- /dev/null +++ b/templates/layout0.html @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + ` + + + + C$50 Math: {% block title %}{% endblock %} + + + + + + + + {% if get_flashed_messages() %} +
+ +
+ {% endif %} + +
+ {% block main %}{% endblock %} +
+ +
+ Huge thanks to the staff at Harvard's CS50. +
+ + + + diff --git a/templates/login.html b/templates/login.html new file mode 100644 index 0000000..0a2404b --- /dev/null +++ b/templates/login.html @@ -0,0 +1,17 @@ +{% extends "layout.html" %} + +{% block title %} + Log In +{% endblock %} + +{% block main %} +
+
+ +
+
+ +
+ +
+{% endblock %} diff --git a/templates/maxmin.html b/templates/maxmin.html new file mode 100644 index 0000000..69b0b82 --- /dev/null +++ b/templates/maxmin.html @@ -0,0 +1,31 @@ +{% extends "layout.html" %} + +{% block title %} + Max/Min +{% endblock %} + +{% block main %} + Function you would like to Max/Min: +
+
+ +
+

Your Input Will Appear Here

+
+ + +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/templates/optimized.html b/templates/optimized.html new file mode 100644 index 0000000..7f04fb2 --- /dev/null +++ b/templates/optimized.html @@ -0,0 +1,64 @@ +{% extends "layout.html" %} + +{% block title %} + Optimized +{% endblock %} + +{% block main %} +
+

Your function is $f(x) = {{ value }}$

+

Your maximum value is ${{ maximum }}$ and your minimum value is ${{ newvar }}$

+
+ + + + + + + + + + + + + + + + + + + + + + + {% for solution in solutions %} + + + + + {% endfor %} + + + + + {% for candidate in candidates %} + + + + + {% endfor %} + + + + + + + + + + + + + +
Step 1Take the Derivative
$f'(x) = {{ fprime }}$
Step 2Set $f'(x) = 0$
$0 = {{ fprime }}$
Step 3Solve for $x$:
$x = {{ solution }}$
Step 4Plug solutions and endpoints into $f(x)$:
$f({{ candidate }}) = {{values[loop.index - 1]}}$
Step 5Grab the highest and lowest values
Your maximum value is ${{ maximum }}$
Your minimum value is ${{ newvar }}$
+{% endblock %} \ No newline at end of file diff --git a/templates/register.html b/templates/register.html new file mode 100644 index 0000000..fc4b942 --- /dev/null +++ b/templates/register.html @@ -0,0 +1,37 @@ +{% extends "layout.html" %} + +{% block title %} + Register +{% endblock %} + +{% block main %} +
+
+ +
+
+ +
+ +
+ +
+ +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/riemann.html b/templates/riemann.html new file mode 100644 index 0000000..c009c4b --- /dev/null +++ b/templates/riemann.html @@ -0,0 +1,42 @@ +{% extends "layout.html" %} + +{% block title %} + Riemann +{% endblock %} + +{% block main %} + Function you would like to integrate: +
+
+ +
+

Your Input Will Appear Here

+ Range of values (a,b): +
+ + +
+ Amount of subintervals (how many rectangles?): +
+ +
+
+ +
+
+ +
+ +
+ + +{% endblock %} \ No newline at end of file diff --git a/templates/rightSummed.html b/templates/rightSummed.html new file mode 100644 index 0000000..31eb384 --- /dev/null +++ b/templates/rightSummed.html @@ -0,0 +1,49 @@ +{% extends "layout.html" %} + +{% block title%} + Summed +{% endblock %} + +{% block main %} + Approximating the integral of $f(x) = {{ value }}$ from ${{ lb }}$ to ${{ ub }}$ using ${{ si }}$ subintervals + + + + + + + + + + + + + + + {% for input in inputs %} + + + + + {% endfor %} + + + + + {% for rectangle in rectangles %} + + + + + {% endfor %} + + + + + + + + + +
Step 1Calculate $\Delta x$
$\Delta x = {{ dx }}$
Step 2Check values for $x_i$ (start at lowerbound a and add $\Delta x$ repeatedly)
$f(x_{{ loop.index }}) = f({{ input }}) = {{ outputs[loop.index - 1] }}$
Step 3Multiply $f(x_i)$ and $\Delta x$ for each subinterval
$f(x_{{ loop.index}}) \Delta x = f({{ inputs[loop.index - 1]}})*{{ dx }} = {{ rectangle }}$
Step 4Add up all products (rectangles) to get final approximation:
The integral of $f(x) = {{ value }}$ from ${{ lb }}$ to ${{ ub }}$ is approximately equal to ${{ result }}$
+{% endblock %} \ No newline at end of file diff --git a/templates/summed.html b/templates/summed.html new file mode 100644 index 0000000..abbb7ee --- /dev/null +++ b/templates/summed.html @@ -0,0 +1,49 @@ +{% extends "layout.html" %} + +{% block title%} + Summed +{% endblock %} + +{% block main %} + Approximating the integral of $f(x) = {{ value }}$ from ${{ lb }}$ to ${{ ub }}$ using ${{ si }}$ subintervals + + + + + + + + + + + + + + + {% for input in inputs %} + + + + + {% endfor %} + + + + + {% for rectangle in rectangles %} + + + + + {% endfor %} + + + + + + + + + +
Step 1Calculate $\Delta x$
$\Delta x = {{ dx }}$
Step 2Check values for $x_i$ (start at lowerbound a and add $\Delta x$ repeatedly)
$f(x_{{ loop.index - 1 }}) = f({{ input }}) = {{ outputs[loop.index - 1] }}$
Step 3Multiply $f(x_i)$ and $\Delta x$ for each subinterval
$f(x_{{ loop.index - 1 }}) \Delta x = f({{ inputs[loop.index - 1]}})*{{ dx }} = {{ rectangle }}$
Step 4Add up all products (rectangles) to get final approximation:
The integral of $f(x) = {{ value }}$ from ${{ lb }}$ to ${{ ub }}$ is approximately equal to ${{ result }}$
+{% endblock %} \ No newline at end of file