Metadata-Version: 2.5
Name: tcalcpyt
Version: 0.1.0
Summary: A custom mathematical framework library for calculus, trigonometry, and plotting.
Project-URL: Homepage, https://github.com
Author-email: Nishchay Singh <10nishchay100@gmail.com>
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: matplotlib>=3.5.0
Description-Content-Type: text/markdown

A robust, pure-Python mathematical library featuring custom-built algorithmic implementations for calculus, trigonometry, statistics, function plotting, and math homework. 

Unlike standard libraries that rely on C-extensions, **tcalcpy** builds essential constants like π and e from first principles, utilizing Taylor series expansions and numerical methods for calculus operations.

## 🚀 Features

*   **🧮 Custom Calculus Engines**: Numerical derivative (central difference) and definite integration (Midpoint/Trapezoidal hybrid rule).
*   **📐 First-Principle Trigonometry**: Custom Ramanujan-based π generation and infinite-series configurations for trigonometric and hyperbolic functions.
*   **📊 Statistical Matrix**: Built-in implementations for variance, standard deviation, and data cleansing.
*   **📈 Integrated Plotting Engine**: Fast algebraic expression evaluation and clean visualization pipelines using `matplotlib`.
*   **🔒 Safe Evaluation Mode**: An Abstract Syntax Tree (`ast`) sandbox parser alongside fallback recursive string evaluations.

## 📦 Installation

Ensure you have your environment configured, then install the package:

```bash
pip install tcalcpy
```

*Note: This library requires `matplotlib>=3.5.0` for plotting functionalities.*

## 🛠️ Quick Start & Examples

### 1. Calculus & Equation Solving
Evaluate derivatives, definite integrals, or solve algebraic roots using numerical approximations:

```python
import tcalcpy as tp

# Calculate the derivative of an equation at x = 2
deriv = tp.derivitive("x^2 + 5x", 2)
print(f"Derivative at x=2: {deriv}") # Output: ~9.0

# Calculate the definite integral from x = 0 to 4
area = tp.integral("x^2", 0, 4)
print(f"Integral value: {area}") # Output: ~21.333

# Solve an equation root
root = tp.solve_eq("x^2 - 4")
print(f"Root found at: {root}") # Output: 2.0
```

### 2. Trigonometry & Precision Constants
Access exact values calculated algorithmically via summation structures:

```python
import tcalcpy as tp

print(f"Custom PI: {tp.pi()}")
print(f"Custom E: {tp.e()}")

# Evaluate trigonometric functions (Both Radians and Degrees supported)
print(f"Sin(Radian): {tp.sin(3.14159)}")
print(f"Sin(Degree): {tp.sindeg(90)}")
```

### 3. Visualizing Algebraic Expressions
Pass string expressions directly into the automated plotting layout:

```python
import tcalcpy as tp

# Automatically builds a styled graph using matplotlib
tp.plot("x^3 - 3x", x_min=-5, x_max=5)
```

## 📋 API Reference Summary

| Function | Description |
| :--- | :--- |
| `safe_eval(expr, x)` | Secure abstract syntax tree runner for simple evaluations. |
| `derivitive(expr, x)` | Computes $f'(x)$ using a high-precision limit slice. |
| `integral(expr, low, high)`| Integrates equations across 1,000,000 evaluation steps. |
| `solve_eq(expr)` | Custom Newton-Raphson implementation to find algebraic roots. |
| `ln(number)` | Computes natural logarithms including complex results for negative values. |
| `isprime(number)` | Highly optimized trial division primality tester. |
| `plot(expr, min, max)` | Validates domains, filters complex values, and renders coordinate graphs. |