Metadata-Version: 2.5
Name: linear-algebra01-kittithuch
Version: 0.1.7
Summary: แพ็กเกจสำหรับ linear algebra
Project-URL: Homepage, https://github.com/username/my_package
Project-URL: Documentation, https://github.com/username/my_package#readme
Project-URL: Repository, https://github.com/username/my_package.git
Project-URL: Bug Tracker, https://github.com/username/my_package/issues
Author-email: Kittithuch Chuaynoo <qmedikup@gmail.com>
License: MIT
License-File: LICENSE
Keywords: linear algebra,math
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# Linear Algebra Package by Kittithuch (linear_algebra01_kittithuch)

linear_algebra01_kittithuch คือ Python Package ที่พัฒนาขึ้นสำหรับการคำนวณและศึกษาวิชา พีชคณิตเชิงเส้น (Linear Algebra) โดยครอบคลุมตั้งแต่การดำเนินการพื้นฐานของเวกเตอร์ การตรวจสอบคุณสมบัติของสเปซเชิงเส้น (Vector Space & Subspace) ไปจนถึงการแสดงผลเชิงทัศนสัมผัส (Data Visualization) ในรูปแบบ 2D, 3D Interactive และ Graph Theory

---

## 🚀 คุณสมบัติหลัก (Features)

* Vector Operations: บวกเวกเตอร์, คูณสเกลาร์, หาขนาด (Magnitude), หาเวกเตอร์หนึ่งหน่วย (Unit Vector) และตรวจสอบเวกเตอร์ศูนย์[cite: 1, 3]
* Subspace & Span: คำนวณผลรวมเชิงเส้น (Linear Combination), ตรวจสอบความเป็นอิสระเชิงเส้น (Linear Independence), ตรวจสอบการ Span ใน R^2 และสร้าง Standard Basis ใน R^n[cite: 1, 2]
* Data Visualization Module (NEW!):
* Matplotlib: แสดงผลเวกเตอร์ 2D และผลรวมเชิงเส้นบนระนาบฉาก
* Plotly: พล็อตระนาบการ Span (Spanning Plane) ในมิติ 3D แบบ Interactive (ซูม หมุน ดูได้ผ่าน Web Browser)
* NetworkX: แปลง Adjacency Matrix ให้เป็น Directed Graph แบบภาพเครือข่ายโหนด
* PyVista: เรนเดอร์สนามเวกเตอร์ 3D (3D Vector Field) ความละเอียดสูง



---

## 📦 การติดตั้ง (Installation)

สามารถติดตั้งแพ็กเกจได้ง่ายๆ ผ่าน pip:

```bash
pip install linear_algebra01_kittithuch

```

*(หมายเหตุ: แนะนำให้ใช้งานบน Python 64-bit และติดตั้งไลบรารีเสริมสำหรับการแสดงผล เช่น matplotlib, plotly, networkx, pyvista)*

---

## 💡 ตัวอย่างการใช้งาน (Usage Examples)

### 1. การคำนวณเวกเตอร์และการตรวจสอบสเปซย่อย

```python
import linear_algebra01_kittithuch as lak

# 1. การบวกและคูณสเกลาร์
u = [1.0, 2.0, 3.0]
v = [4.0, 5.0, 6.0]

u_plus_v = lak.vector_add(u, v)
print("u + v =", u_plus_v)  # Output: [5.0, 7.0, 9.0]

# 2. คำนวณผลรวมเชิงเส้น (Linear Combination: 2*u - 1*v)
scalars = [2.0, -1.0]
result = lak.linear_combination(scalars, [u, v])
print("2*u - v =", result)  # Output: [-2.0, -1.0, 0.0]

# 3. สร้าง Standard Basis สำหรับ R^3
basis = lak.standard_basis_r(3)
print("Standard Basis R^3:", basis)
# Output: [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]

```

### 2. การแสดงผลกราฟิก (Visualization)

```python
import linear_algebra01_kittithuch as lak

# พล็อตเวกเตอร์ 2D และผลรวมเชิงเส้น
v1 = [3.0, 2.0]
v2 = [-1.0, 4.0]
v3 = [2.0, 6.0] # v1 + v2
lak.plot_vectors_2d([v1, v2, v3], labels=["v1", "v2", "v1+v2"])

# พล็อตระนาบ Span ใน 3D ด้วย Plotly
lak.plot_spanning_plane_3d([1, 0, 2], [0, 2, 1])

# แสดง Matrix ในรูปแบบ Graph
adj_matrix = [
    [0.0, 1.5, 0.0],
    [2.0, 0.0, 3.1],
    [0.0, 0.5, 0.0]
]
lak.plot_matrix_as_graph(adj_matrix)

```

---

## 🛠️ โครงสร้างฟังก์ชันทั้งหมดในแพ็กเกจ

* Vector Operations:
* vector_add(u, v) - บวกเวกเตอร์ขนาดเท่ากัน 2 ตัว[cite: 1, 3]
* scalar_multiply(c, v) - คูณเวกเตอร์ v ด้วยสเกลาร์ c[cite: 1, 3]
* vector_magnitude(v) - หาขนาดของเวกเตอร์ (Magnitude/Norm)[cite: 1, 3]
* unit_vector(v) - คำนวณเวกเตอร์หนึ่งหน่วยทิศทางเดียวกับ v[cite: 1, 3]
* is_zero_vector(v) - ตรวจสอบว่าเป็นเวกเตอร์ศูนย์หรือไม่[cite: 1, 3]


* Subspace & Span:
* linear_combination(scalars, vectors) - คำนวณผลรวมเชิงเส้น c1*v1 + c2*v2 + ... + cn*vn[cite: 1, 2]
* is_subspace_contains_zero(vectors) - ตรวจสอบว่าชุดเวกเตอร์มีเวกเตอร์ศูนย์อยู่หรือไม่[cite: 1, 2]
* is_linearly_independent_2d(u, v) - ตรวจสอบการเป็นอิสระเชิงเส้นใน 2D[cite: 1, 2]
* is_spanning_r2(v1, v2) - ตรวจสอบว่า v1, v2 แผ่กว้างครอบคลุม R^2 หรือไม่[cite: 1, 2]
* standard_basis_r(n) - สร้างฐานหลักเดิม (Standard Basis) สำหรับ R^n[cite: 1, 2]


* Visualization:
* plot_vectors_2d(vectors, ...) - พล็อตเวกเตอร์ 2D ด้วย Matplotlib
* plot_spanning_plane_3d(v1, v2) - พล็อตระนาบ Spanning Plane 3D แบบ Interactive ด้วย Plotly
* plot_matrix_as_graph(matrix) - แปลง Matrix เป็น Directed Graph ด้วย NetworkX
* plot_3d_vector_field() - แสดงผล 3D Vector Field ด้วย PyVista



---

## 👨‍💻 ผู้พัฒนา (Author)

* พัฒนาโดย: Kittithuch[cite: 1]
* Version: 0.2.0
* License: MIT License