Metadata-Version: 2.4
Name: Vectorian-arjungangwar
Version: 0.1.0
Summary: Professional vector mathematics toolkit for school, engineering, and scientific Python workflows
Author-email: Arjun Singh Gangwar <arjungangwariitpkd@email.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/arjungangwar/vectorian
Project-URL: Repository, https://github.com/arjungangwar/vectorian
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: license-file

# Vectorian

Vectorian is a practical Python library for vector mathematics. It supports
school-level vector algebra, coordinate geometry, 3D transformations, and
numerical vector calculus in a small package that is easy to install and use.

## Installation

```bash
pip install Vectorian-arjungangwar
```

For local development:

```bash
pip install -e ".[dev]"
pytest
```

## Quick Start

```python
from vectorian import Vector, Vector3D, dot, cross, angle_between

u = Vector(1, 2, 3)
v = Vector(4, 5, 6)

print(u + v)                 # (5.0000, 7.0000, 9.0000)
print(dot(u, v))             # 32.0
print(u.magnitude())         # 3.741657386...
print(angle_between(u, v, radians=False))

i = Vector3D(1, 0, 0)
j = Vector3D(0, 1, 0)
print(cross(i, j))           # Vector3D(0.0000, 0.0000, 1.0000)
```

## Vector Algebra

```python
from vectorian import (
    Vector,
    are_parallel,
    direction_cosines,
    gram_schmidt,
    projection,
    scalar_projection,
)

a = Vector(3, 4)
b = Vector(1, 0)

print(a.normalize())
print(projection(a, b))
print(scalar_projection(a, b))
print(direction_cosines(a))
print(are_parallel(Vector(2, 4), Vector(1, 2)))

basis = gram_schmidt([Vector(1, 1, 0), Vector(1, 0, 1)])
```

## Coordinate Geometry Helpers

These helpers cover common CBSE/ISC/NCERT vector and 3D geometry tasks:
section formula, midpoint, distance, collinearity, coplanarity, areas, and
volumes.

```python
from vectorian import (
    Vector,
    Vector3D,
    are_collinear,
    are_coplanar,
    centroid,
    midpoint,
    section_point,
    tetrahedron_volume,
    triangle_area,
    vector_between,
)

a = Vector(0, 0)
b = Vector(6, 6)

print(midpoint(a, b))                  # (3.0000, 3.0000)
print(section_point(a, b, 1, 2))       # internal ratio 1:2
print(vector_between(a, b))
print(triangle_area(Vector(0, 0), Vector(4, 0), Vector(0, 3)))

p = Vector3D(0, 0, 0)
q = Vector3D(1, 0, 0)
r = Vector3D(0, 1, 0)
s = Vector3D(0, 0, 1)

print(are_collinear(Vector(0, 0), Vector(1, 1), Vector(2, 2)))
print(are_coplanar(p, q, r, Vector3D(2, 2, 0)))
print(tetrahedron_volume(p, q, r, s))
print(centroid([p, q, r, s]))
```

## 3D Transformations

```python
from vectorian import Vector3D, rotate_vector, spherical_to_cartesian

v = Vector3D(1, 0, 0)
print(rotate_vector(v, "z", 90))
print(v.rotate_around_axis(Vector3D(0, 0, 1), 90))
print(spherical_to_cartesian(1, 1.57079632679, 0))
```

## Vector Calculus

```python
from vectorian import Vector3D, VectorField, gradient, divergence, curl

def f(x, y, z):
    return x*x + y*y + z*z

print(gradient(f, 1, 1, 1))

field = VectorField(
    lambda x, y, z: x,
    lambda x, y, z: y,
    lambda x, y, z: z,
)

print(divergence(field.P, field.Q, field.R, 1, 1, 1))
print(curl(field.P, field.Q, field.R, 1, 1, 1))
```

## Main Features

- N-dimensional vectors with arithmetic, norms, dot products, projections,
  direction ratios, direction cosines, and NumPy conversion.
- 2D scalar cross product and 3D vector cross product.
- `Vector3D` helpers for rotations, spherical/cylindrical coordinates,
  reflections, triple products, and axis angles.
- Coordinate geometry helpers for section formula, midpoint, centroid,
  distance, triangle area, tetrahedron volume, collinearity, and coplanarity.
- Linear algebra helpers including Gram-Schmidt, rank, determinants, and
  linear independence checks.
- Numerical vector calculus: gradient, divergence, curl, Laplacian,
  directional derivative, Jacobian, Hessian, line integrals, scalar fields,
  and vector fields.

## License

MIT License. See `LICENSE` for details.
