-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelp.py
46 lines (40 loc) · 1.64 KB
/
help.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import streamlit as st
def display_help():
st.write("### How to Write Mathematical Equations")
st.markdown(
"""
This app uses **Python syntax** for mathematical functions. Below are examples to help you input your equation correctly:
#### Supported Operations:
- **Addition:** Use `+`.
Example: `x + 3`
- **Subtraction:** Use `-`.
Example: `x - 2`
- **Multiplication:** Use `*`.
Example: `2 * x`
- **Division:** Use `/`.
Example: `x / 4`
- **Powers:** Use `**`.
Example: `x**2` for \(x^2\)
#### Supported Functions:
- **Square Root:** Use `sqrt(x)` for \( \\sqrt{x} \).
Example: `sqrt(x**2 + 1)` for \( \\sqrt{x^2 + 1} \).
- **Sine:** Use `sin(x)` for \( \\sin(x) \).
- **Cosine:** Use `cos(x)` for \( \\cos(x) \).
- **Tangent:** Use `tan(x)` for \( \\tan(x) \).
- **Exponential:** Use `exp(x)` for \( e^x \).
- **Logarithm:** Use `log(x)` for natural log (\( \\ln(x) \)).
#### Angle Inputs:
- Angles are in **radians** by default.
To use degrees, convert to radians using \( \\text{radians} = \\text{degrees} \\cdot \\frac{\\pi}{180} \):
Example: `sin(x * pi / 180)`.
#### Example Equations:
- \( f(x) = x^2 - 4x + 4 \):
Input: `x**2 - 4*x + 4`
- \( f(x) = \\sin(x) + \\cos(x) \):
Input: `sin(x) + cos(x)`
- \( f(x) = \\sqrt{x^2 + 1} \):
Input: `sqrt(x**2 + 1)`
- \( f(x) = \\log(x) + e^x \):
Input: `log(x) + exp(x)`
"""
)