feat(v3.5.0): Matris Cebiri, Taylor (1D) ve Çok Değişkenli Taylor modüllerinin modernizasyonu
This commit is contained in:
parent
6026945615
commit
0cafe8fccb
12 changed files with 2395 additions and 718 deletions
44
README.md
44
README.md
|
|
@ -1,4 +1,4 @@
|
||||||
# 📐 ttCalculator v3.4.0
|
# 📐 ttCalculator v3.5.0
|
||||||
|
|
||||||
[](https://github.com/LilDosto/ttCalculator/releases)
|
[](https://github.com/LilDosto/ttCalculator/releases)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|
@ -13,11 +13,11 @@ Tüm matematiksel çekirdek, otomatik test paketinden **%100 başarıyla (0 hata
|
||||||
|
|
||||||
## 🚀 Hızlı Başlangıç & Kurulum
|
## 🚀 Hızlı Başlangıç & Kurulum
|
||||||
|
|
||||||
1. **[Releases](https://github.com/LilDosto/ttCalculator/releases/tag/v3.4.0)** sayfasına gidin.
|
1. **[Releases](https://github.com/LilDosto/ttCalculator/releases/tag/v3.5.0)** sayfasına gidin.
|
||||||
2. İhtiyacınıza göre indirin:
|
2. İhtiyacınıza göre indirin:
|
||||||
- **`ttCalculator-v3.4.0-Setup.exe` (Önerilen)**: Standart Windows kurulum sihirbazı. Masaüstüne ve Başlat Menüsüne kısayol oluşturur, Denetim Masası / Program Ekle-Kaldır entegrasyonu sağlar.
|
- **`ttCalculator-v3.5.0-Setup.exe` (Önerilen)**: Standart Windows kurulum sihirbazı. Masaüstüne ve Başlat Menüsüne kısayol oluşturur, Denetim Masası / Program Ekle-Kaldır entegrasyonu sağlar.
|
||||||
- **`ttCalculator.exe`**: Kurulumsuz doğrudan çalıştırılabilen tek dosya taşınabilir (portable) sürüm.
|
- **`ttCalculator.exe`**: Kurulumsuz doğrudan çalıştırılabilen tek dosya taşınabilir (portable) sürüm.
|
||||||
- **`ttCalculator-v3.4.0-win-x64.zip`**: Taşınabilir arşiv paketi.
|
- **`ttCalculator-v3.5.0-win-x64.zip`**: Taşınabilir arşiv paketi.
|
||||||
3. Çift tıklayarak doğrudan çalıştırın — ek bağımlılık gerektirmez!
|
3. Çift tıklayarak doğrudan çalıştırın — ek bağımlılık gerektirmez!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
@ -116,22 +116,46 @@ Uygulama modern koyu tema (Dark Theme) arayüzü ile 13 ana modülden oluşmakta
|
||||||
* **Grafik Stüdyosu Entegrasyonu:** `[📈 Kökü Grafikte Göster]` butonu ile kök noktasını ve fonksiyonu anında Grafik Çizici sekmesine aktarma.
|
* **Grafik Stüdyosu Entegrasyonu:** `[📈 Kökü Grafikte Göster]` butonu ile kök noktasını ve fonksiyonu anında Grafik Çizici sekmesine aktarma.
|
||||||
* **Nümerik Koruma:** $f'(x) \approx 0$ sıfıra bölme ve ıraksama (divergence) denetimleri.
|
* **Nümerik Koruma:** $f'(x) \approx 0$ sıfıra bölme ve ıraksama (divergence) denetimleri.
|
||||||
|
|
||||||
### 7. 📜 Taylor Serisi Açılımı (Kesirli & Faktöriyelli Form)
|
### 7. 📜 Taylor Serisi Hesaplayıcı (Tek Değişkenli - v3.5)
|
||||||
* Tek ve çok değişkenli Taylor açılımlarında katsayılar hem ondalıklı, hem **sadeleştirilmiş kesirli formda**, hem de formülasyona tam uygun **analitik faktöriyelli formda** ($\frac{f^{(k)}(a)}{k!}$) gösterilir.
|
* **Gelişmiş Formül & Merkez Girişi:** $f(x)$ girdi kartı, Maclaurin ($a=0$) hızlı butonu, $n \in [1, 20]$ derece seçimi ve hızlı fonksiyon şablonları ($\sin, \cos, e^x, \ln(1+x), \frac{1}{1-x}, \arctan$).
|
||||||
|
* **Vurgulu Polinom Kartı:** Büyük matematiksel $P_n(x)$ gösterimi, `[📈 Grafikte Göster]`, `[📋 Polinomu Kopyala]`, `[LaTeX Kopyala]` entegrasyonu.
|
||||||
|
* **Mini 2D Yakınsama Önizleme Tuvali:** Gerçek fonksiyon $f(x)$ ile Taylor yaklaşımı $P_n(x)$'in merkez $a$ etrafındaki yakınsamasını gerçek zamanlı çizen çift tamponlu 2B kanvas.
|
||||||
|
* **3 Sekmeli Analitik Sonuçlar:**
|
||||||
|
1. *Katsayılar & Türev Tablosu (DataGridView):* Her $k$ mertebesi için $f^{(k)}(x)$, $f^{(k)}(a)$, $k!$, kesirli ve ondalıklı $c_k$ katsayıları ve terimler.
|
||||||
|
2. *Hata Analizi & Lagrange Kalanı ($R_n(x)$):* Teorik formül ve test noktalarında ($a \pm 0.1, a \pm 0.5, a \pm 1, a \pm 2$) mutlak ve bağıl hata analizi tablosu.
|
||||||
|
3. *Detaylı Rapor:* Sadeleştirilmiş kesirli, faktöriyelli ve ondalıklı tam açılımlar.
|
||||||
|
|
||||||
### 8. 🎲 Kombinatorik, Polar Dönüşüm ve Özel Fonksiyonlar (v3.4)
|
### 8. 🌐 Çok Değişkenli Taylor Serisi & Teğet Düzlem Stüdyosu (v3.5)
|
||||||
|
* **Kompakt Etiket/Chip Mimarisi:** $f(x_1, \dots, x_k)$ için dinamik değişken ve merkez noktası chip kartları (`[Var: x | x₀: 0 | ✕]`), `[+ Değişken Ekle]`, `[Tümü = 0]`.
|
||||||
|
* **Katmanlı Analiz Blokları:**
|
||||||
|
- *Blok 1 (Doğrusal Yaklaşım $n=1$):* Teğet düzlem denklemi $L(x, y)$, $\nabla f(a)$ gradyan vektörü ve `[📋 Teğet Düzlemini Kopyala]`.
|
||||||
|
- *Blok 2 (Kuadratik Yaklaşım $n=2$):* Hessian matrisi $H(a)$, ikinci derece terimler $Q(x, y)$ ve 2 değişkenli ekstremum teşhisi ($\det(H) > 0 \implies$ min/max, $\det(H) < 0 \implies$ eyer noktası).
|
||||||
|
- *Blok 3 (Tam Polinom):* $T_n$ kesirli, faktöriyelli ve ondalıklı tam çok değişkenli açılım.
|
||||||
|
* **Kısmi & Çapraz Türevler Tablosu (DataGridView):** Çoklu indeks $|\alpha|$, diferansiyel operatörleri, sayısal değerler, $\alpha!$ paydası ve katsayılar.
|
||||||
|
|
||||||
|
### 9. 🎲 Kombinatorik, Polar Dönüşüm ve Özel Fonksiyonlar (v3.4)
|
||||||
* **4 Kartlı Modern Mimari:** Ayrık Matematik ($n!, P, C$), Asenkron Dizi Üreteci (güvenlik koruması ve sayfalamalı gösterim), Vektörel Polar Dönüşüm (canlı vektör açısı ve büyüklük diyagramı) ve İleri Analitik Fonksiyonlar ($\sinh, \cosh, \tanh, \log_b$).
|
* **4 Kartlı Modern Mimari:** Ayrık Matematik ($n!, P, C$), Asenkron Dizi Üreteci (güvenlik koruması ve sayfalamalı gösterim), Vektörel Polar Dönüşüm (canlı vektör açısı ve büyüklük diyagramı) ve İleri Analitik Fonksiyonlar ($\sinh, \cosh, \tanh, \log_b$).
|
||||||
* **Zengin Sekmeli Çıktı Alanı:** Özet Kartı, Pascal Üçgeni Piramidi, Sayfalamalı Kombinasyon Listesi, `[JSON İndir]` ve `[Kopyala]` araçları.
|
* **Zengin Sekmeli Çıktı Alanı:** Özet Kartı, Pascal Üçgeni Piramidi, Sayfalamalı Kombinasyon Listesi, `[JSON İndir]` ve `[Kopyala]` araçları.
|
||||||
|
|
||||||
### 9. 📐 Nümerik Türev, Kısmi Türev & Hessian Stüdyosu (v3.4)
|
### 10. 📐 Nümerik Türev, Kısmi Türev & Hessian Stüdyosu (v3.4)
|
||||||
* **Nümerik Ayar Çubuğu:** $h$ adım boyutu hızlı seçimleri (`1e-3`, `1e-5`, `1e-7`), Merkezi/İleri/Geri fark formülleri, $O(h^2), O(h^4), O(h^6)$ doğruluk derecesi.
|
* **Nümerik Ayar Çubuğu:** $h$ adım boyutu hızlı seçimleri (`1e-3`, `1e-5`, `1e-7`), Merkezi/İleri/Geri fark formülleri, $O(h^2), O(h^4), O(h^6)$ doğruluk derecesi.
|
||||||
* **Tek Değişkenli Türev & Teğet Çizici:** $f^{(n)}(x_0)$ hesabı, teğet ve normal doğru denklemleri, `[📈 Teğeti Grafikte Çiz]` entegrasyonu.
|
* **Tek Değişkenli Türev & Teğet Çizici:** $f^{(n)}(x_0)$ hesabı, teğet ve normal doğru denklemleri, `[📈 Teğeti Grafikte Çiz]` entegrasyonu.
|
||||||
* **Çok Değişkenli Analiz, Gradyan & Hessian:** Dinamik değişken ekleme, $\nabla f$ gradyan vektörü, birim $\vec{u}$ vektörü ile yönlü türev ($D_{\vec{u}} f$) ve 2. mertebe Hessian simetrik matrisi ile yerel ekstremum (min/max/eyer) testi.
|
* **Çok Değişkenli Analiz, Gradyan & Hessian:** Dinamik değişken ekleme, $\nabla f$ gradyan vektörü, birim $\vec{u}$ vektörü ile yönlü türev ($D_{\vec{u}} f$) ve 2. mertebe Hessian simetrik matrisi ile yerel ekstremum (min/max/eyer) testi.
|
||||||
|
|
||||||
### 10. 🔢 Basit & Bilimsel Hesap Makinesi
|
### 11. 🧮 Matris Cebiri & Ayrıştırma Stüdyosu (v3.5)
|
||||||
|
* **Dinamik Mini Tablolar (DataGridView):** A ve B matrisleri için otomatik sütun genişlemeli, klavye gezintili ve Excel / CSV panosundan doğrudan yapıştırma (`Ctrl+V`) ve kopyalama (`Ctrl+C`) destekli gridler.
|
||||||
|
* **Hızlı Matris Araçları:** `[Birim (I)]`, `[Sıfır]`, `[Rastgele]`, `[SPD Üret]` ($M = R^T R + n I$ simetrik pozitif tanımlı matris oluşturucu), `[A ↔ B Takas]`, `[A → B Kopyala]`.
|
||||||
|
* **Kategorize İşlem Sekmeleri:**
|
||||||
|
1. *Tekil Analiz (Matrix A):* Tam Analiz, $A^{-1}$ (Ters Matris), $A^T$ (Transpoz), $-A$, İz & Determinant, 1/2/$\infty$/Frobenius Normları, Kondisyon Sayısı $\kappa(A)$ ve Rank.
|
||||||
|
2. *Ayrıştırmalar (Decompositions):* LU ($P\cdot A = L\cdot U$), QR (Householder yansımaları), Cholesky ($A = L\cdot L^T$, otomatik SPD doğrulaması), SVD ($A = U\cdot\Sigma\cdot V^T$), Özdeğerler ve Özvektörler ($\lambda, V$).
|
||||||
|
3. *İki Matrisli Cebir & Sistem Çözücü:* $A + B$, $A - B$, $A \times B$, $k \cdot A$, $A \odot B$ (Hadamard), $A \oslash B$ (Noktasal Böl), Lineer Sistem Çözücü ($A\cdot X = B$), Transpoz Denklem Çözücü ($A^T\cdot X^T = B^T$).
|
||||||
|
* **Üst KPI Kartları & Rapor:** $\det(A)$, $\text{rank}(A)$ ve $\kappa(A)$ durum rozetleri, `[📥 Ans → A]`, `[📥 Ans → B]`, `[LaTeX Kopyala]` (bmatrix) ve `[📋 Kopyala]`.
|
||||||
|
* **Nümerik Koruma:** Tekil matris ($|\det| < 10^{-12}$) uyarısı ve non-SPD Cholesky uyarıları.
|
||||||
|
|
||||||
|
### 12. 🔢 Basit & Bilimsel Hesap Makinesi
|
||||||
* 128-bit `decimal` motoru, RAD/DEG modları, otomatik parantez tamamlama ve geçmiş paneli.
|
* 128-bit `decimal` motoru, RAD/DEG modları, otomatik parantez tamamlama ve geçmiş paneli.
|
||||||
|
|
||||||
### 10. ⚖️ Doğrusal & Doğrusal Olmayan Denklem Sistemleri
|
### 13. ⚖️ Doğrusal & Doğrusal Olmayan Denklem Sistemleri
|
||||||
* LU, QR, Ters Matris, Gauss-Seidel ve Çok Boyutlu Newton-Raphson çözücüleri.
|
* LU, QR, Ters Matris, Gauss-Seidel ve Çok Boyutlu Newton-Raphson çözücüleri.
|
||||||
|
|
||||||
### 11. 🧮 Gelişmiş Matris Hesaplayıcı & 5 Temel Ayrışım
|
### 11. 🧮 Gelişmiş Matris Hesaplayıcı & 5 Temel Ayrışım
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
; Script generated by Antigravity for ttCalculator
|
; Script generated by Antigravity for ttCalculator
|
||||||
#define MyAppName "ttCalculator"
|
#define MyAppName "ttCalculator"
|
||||||
#define MyAppVersion "3.4.0"
|
#define MyAppVersion "3.5.0"
|
||||||
#define MyAppPublisher "LilDosto"
|
#define MyAppPublisher "LilDosto"
|
||||||
#define MyAppURL "https://github.com/LilDosto/ttCalculator"
|
#define MyAppURL "https://github.com/LilDosto/ttCalculator"
|
||||||
#define MyAppExeName "ttCalculator.exe"
|
#define MyAppExeName "ttCalculator.exe"
|
||||||
|
|
@ -25,7 +25,7 @@ DefaultGroupName={#MyAppName}
|
||||||
AllowNoIcons=yes
|
AllowNoIcons=yes
|
||||||
LicenseFile=..\LICENSE
|
LicenseFile=..\LICENSE
|
||||||
OutputDir=..\Release
|
OutputDir=..\Release
|
||||||
OutputBaseFilename=ttCalculator-v3.4.0-Setup
|
OutputBaseFilename=ttCalculator-v3.5.0-Setup
|
||||||
SetupIconFile=..\Release\logo.ico
|
SetupIconFile=..\Release\logo.ico
|
||||||
Compression=lzma2/ultra64
|
Compression=lzma2/ultra64
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
|
|
|
||||||
|
|
@ -11,59 +11,93 @@ namespace MathApp.Controls
|
||||||
private Label lblDesc;
|
private Label lblDesc;
|
||||||
|
|
||||||
// Matrix A section
|
// Matrix A section
|
||||||
|
private Panel pnlCardA;
|
||||||
private Label lblHeaderA;
|
private Label lblHeaderA;
|
||||||
private NumericUpDown numRowsA;
|
private NumericUpDown numRowsA;
|
||||||
private NumericUpDown numColsA;
|
private NumericUpDown numColsA;
|
||||||
|
private Label lblTimesA;
|
||||||
private Button btnResizeA;
|
private Button btnResizeA;
|
||||||
private Button btnRandomA;
|
private Button btnRandomA;
|
||||||
private Button btnIdentityA;
|
private Button btnIdentityA;
|
||||||
private Button btnZeroA;
|
private Button btnZeroA;
|
||||||
private Panel pnlGridA;
|
private Button btnSpdA;
|
||||||
|
private Button btnPasteA;
|
||||||
|
private DataGridView dgvMatrixA;
|
||||||
|
|
||||||
// Matrix B section
|
// Matrix B section
|
||||||
|
private Panel pnlCardB;
|
||||||
private Label lblHeaderB;
|
private Label lblHeaderB;
|
||||||
private NumericUpDown numRowsB;
|
private NumericUpDown numRowsB;
|
||||||
private NumericUpDown numColsB;
|
private NumericUpDown numColsB;
|
||||||
|
private Label lblTimesB;
|
||||||
private Button btnResizeB;
|
private Button btnResizeB;
|
||||||
private Button btnRandomB;
|
private Button btnRandomB;
|
||||||
private Button btnIdentityB;
|
private Button btnIdentityB;
|
||||||
private Button btnZeroB;
|
private Button btnZeroB;
|
||||||
private Button btnCopyAToB;
|
private Button btnCopyAToB;
|
||||||
private Panel pnlGridB;
|
private Button btnSwapAB;
|
||||||
|
private Button btnPasteB;
|
||||||
|
private DataGridView dgvMatrixB;
|
||||||
|
|
||||||
// Scalar & Presets
|
// Scalar & Presets
|
||||||
|
private Panel pnlScalarPreset;
|
||||||
private Label lblScalar;
|
private Label lblScalar;
|
||||||
private TextBox txtScalar;
|
private TextBox txtScalar;
|
||||||
private Button btnExSPD;
|
private Button btnExSPD;
|
||||||
private Button btnExGeneral;
|
private Button btnExGeneral;
|
||||||
|
private Button btnExOrthogonal;
|
||||||
|
|
||||||
// Single Matrix A Operations
|
// Segmented Operations Tabs
|
||||||
private Label lblOpsA;
|
private TabControl tabOperations;
|
||||||
|
private TabPage tabUnary;
|
||||||
|
private TabPage tabDecomp;
|
||||||
|
private TabPage tabBinary;
|
||||||
|
|
||||||
|
// Tab 1 Unary Buttons
|
||||||
private Button btnAllProps;
|
private Button btnAllProps;
|
||||||
|
private Button btnInverse;
|
||||||
|
private Button btnTranspose;
|
||||||
|
private Button btnUnaryMinus;
|
||||||
|
private Button btnTraceDet;
|
||||||
|
private Button btnNorms;
|
||||||
|
private Button btnCondRank;
|
||||||
|
|
||||||
|
// Tab 2 Decompositions Buttons
|
||||||
private Button btnLU;
|
private Button btnLU;
|
||||||
private Button btnQR;
|
private Button btnQR;
|
||||||
private Button btnCholesky;
|
private Button btnCholesky;
|
||||||
private Button btnSVD;
|
private Button btnSVD;
|
||||||
private Button btnEigen;
|
private Button btnEigen;
|
||||||
private Button btnInverse;
|
|
||||||
|
|
||||||
// Dual Matrix A & B Operations
|
// Tab 3 Binary & Solvers Buttons
|
||||||
private Label lblOpsAB;
|
|
||||||
private Button btnAddAB;
|
private Button btnAddAB;
|
||||||
private Button btnSubAB;
|
private Button btnSubAB;
|
||||||
private Button btnMulAB;
|
private Button btnMulAB;
|
||||||
|
private Button btnScalarMul;
|
||||||
private Button btnElemMul;
|
private Button btnElemMul;
|
||||||
private Button btnElemDiv;
|
private Button btnElemDiv;
|
||||||
private Button btnScalarMul;
|
|
||||||
private Button btnSolveAXB;
|
private Button btnSolveAXB;
|
||||||
private Button btnSolveTrans;
|
private Button btnSolveTrans;
|
||||||
|
|
||||||
// Right side results & actions
|
// Right side results & actions
|
||||||
private Panel pnlRight;
|
private Panel pnlRight;
|
||||||
|
private Panel pnlKpiContainer;
|
||||||
|
private Panel pnlKpiDet;
|
||||||
|
private Label lblKpiDetTitle;
|
||||||
|
private Label lblKpiDetVal;
|
||||||
|
private Panel pnlKpiRank;
|
||||||
|
private Label lblKpiRankTitle;
|
||||||
|
private Label lblKpiRankVal;
|
||||||
|
private Panel pnlKpiCond;
|
||||||
|
private Label lblKpiCondTitle;
|
||||||
|
private Label lblKpiCondVal;
|
||||||
|
|
||||||
private Panel pnlResultToolbar;
|
private Panel pnlResultToolbar;
|
||||||
private Button btnAnsToA;
|
|
||||||
private Button btnCopyMatrix;
|
|
||||||
private Label lblResultTitle;
|
private Label lblResultTitle;
|
||||||
|
private Button btnAnsToA;
|
||||||
|
private Button btnAnsToB;
|
||||||
|
private Button btnCopyLatex;
|
||||||
|
private Button btnCopyMatrix;
|
||||||
private RichTextBox txtResult;
|
private RichTextBox txtResult;
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
|
|
@ -78,284 +112,401 @@ namespace MathApp.Controls
|
||||||
this.lblTitle = new Label();
|
this.lblTitle = new Label();
|
||||||
this.lblDesc = new Label();
|
this.lblDesc = new Label();
|
||||||
|
|
||||||
|
// A controls
|
||||||
|
this.pnlCardA = new Panel();
|
||||||
this.lblHeaderA = new Label();
|
this.lblHeaderA = new Label();
|
||||||
this.numRowsA = new NumericUpDown();
|
this.numRowsA = new NumericUpDown();
|
||||||
|
this.lblTimesA = new Label();
|
||||||
this.numColsA = new NumericUpDown();
|
this.numColsA = new NumericUpDown();
|
||||||
this.btnResizeA = new Button();
|
this.btnResizeA = new Button();
|
||||||
this.btnRandomA = new Button();
|
this.btnRandomA = new Button();
|
||||||
this.btnIdentityA = new Button();
|
this.btnIdentityA = new Button();
|
||||||
this.btnZeroA = new Button();
|
this.btnZeroA = new Button();
|
||||||
this.pnlGridA = new Panel();
|
this.btnSpdA = new Button();
|
||||||
|
this.btnPasteA = new Button();
|
||||||
|
this.dgvMatrixA = new DataGridView();
|
||||||
|
|
||||||
|
// B controls
|
||||||
|
this.pnlCardB = new Panel();
|
||||||
this.lblHeaderB = new Label();
|
this.lblHeaderB = new Label();
|
||||||
this.numRowsB = new NumericUpDown();
|
this.numRowsB = new NumericUpDown();
|
||||||
|
this.lblTimesB = new Label();
|
||||||
this.numColsB = new NumericUpDown();
|
this.numColsB = new NumericUpDown();
|
||||||
this.btnResizeB = new Button();
|
this.btnResizeB = new Button();
|
||||||
this.btnRandomB = new Button();
|
this.btnRandomB = new Button();
|
||||||
this.btnIdentityB = new Button();
|
this.btnIdentityB = new Button();
|
||||||
this.btnZeroB = new Button();
|
this.btnZeroB = new Button();
|
||||||
this.btnCopyAToB = new Button();
|
this.btnCopyAToB = new Button();
|
||||||
this.pnlGridB = new Panel();
|
this.btnSwapAB = new Button();
|
||||||
|
this.btnPasteB = new Button();
|
||||||
|
this.dgvMatrixB = new DataGridView();
|
||||||
|
|
||||||
|
// Presets & Scalar
|
||||||
|
this.pnlScalarPreset = new Panel();
|
||||||
this.lblScalar = new Label();
|
this.lblScalar = new Label();
|
||||||
this.txtScalar = new TextBox();
|
this.txtScalar = new TextBox();
|
||||||
this.btnExSPD = new Button();
|
this.btnExSPD = new Button();
|
||||||
this.btnExGeneral = new Button();
|
this.btnExGeneral = new Button();
|
||||||
|
this.btnExOrthogonal = new Button();
|
||||||
|
|
||||||
this.lblOpsA = new Label();
|
// Tabs
|
||||||
|
this.tabOperations = new TabControl();
|
||||||
|
this.tabUnary = new TabPage();
|
||||||
|
this.tabDecomp = new TabPage();
|
||||||
|
this.tabBinary = new TabPage();
|
||||||
|
|
||||||
|
// Tab 1 buttons
|
||||||
this.btnAllProps = new Button();
|
this.btnAllProps = new Button();
|
||||||
|
this.btnInverse = new Button();
|
||||||
|
this.btnTranspose = new Button();
|
||||||
|
this.btnUnaryMinus = new Button();
|
||||||
|
this.btnTraceDet = new Button();
|
||||||
|
this.btnNorms = new Button();
|
||||||
|
this.btnCondRank = new Button();
|
||||||
|
|
||||||
|
// Tab 2 buttons
|
||||||
this.btnLU = new Button();
|
this.btnLU = new Button();
|
||||||
this.btnQR = new Button();
|
this.btnQR = new Button();
|
||||||
this.btnCholesky = new Button();
|
this.btnCholesky = new Button();
|
||||||
this.btnSVD = new Button();
|
this.btnSVD = new Button();
|
||||||
this.btnEigen = new Button();
|
this.btnEigen = new Button();
|
||||||
this.btnInverse = new Button();
|
|
||||||
|
|
||||||
this.lblOpsAB = new Label();
|
// Tab 3 buttons
|
||||||
this.btnAddAB = new Button();
|
this.btnAddAB = new Button();
|
||||||
this.btnSubAB = new Button();
|
this.btnSubAB = new Button();
|
||||||
this.btnMulAB = new Button();
|
this.btnMulAB = new Button();
|
||||||
|
this.btnScalarMul = new Button();
|
||||||
this.btnElemMul = new Button();
|
this.btnElemMul = new Button();
|
||||||
this.btnElemDiv = new Button();
|
this.btnElemDiv = new Button();
|
||||||
this.btnScalarMul = new Button();
|
|
||||||
this.btnSolveAXB = new Button();
|
this.btnSolveAXB = new Button();
|
||||||
this.btnSolveTrans = new Button();
|
this.btnSolveTrans = new Button();
|
||||||
|
|
||||||
|
// Right side
|
||||||
this.pnlRight = new Panel();
|
this.pnlRight = new Panel();
|
||||||
|
this.pnlKpiContainer = new Panel();
|
||||||
|
this.pnlKpiDet = new Panel();
|
||||||
|
this.lblKpiDetTitle = new Label();
|
||||||
|
this.lblKpiDetVal = new Label();
|
||||||
|
this.pnlKpiRank = new Panel();
|
||||||
|
this.lblKpiRankTitle = new Label();
|
||||||
|
this.lblKpiRankVal = new Label();
|
||||||
|
this.pnlKpiCond = new Panel();
|
||||||
|
this.lblKpiCondTitle = new Label();
|
||||||
|
this.lblKpiCondVal = new Label();
|
||||||
|
|
||||||
this.pnlResultToolbar = new Panel();
|
this.pnlResultToolbar = new Panel();
|
||||||
this.lblResultTitle = new Label();
|
this.lblResultTitle = new Label();
|
||||||
this.btnAnsToA = new Button();
|
this.btnAnsToA = new Button();
|
||||||
|
this.btnAnsToB = new Button();
|
||||||
|
this.btnCopyLatex = new Button();
|
||||||
this.btnCopyMatrix = new Button();
|
this.btnCopyMatrix = new Button();
|
||||||
this.txtResult = new RichTextBox();
|
this.txtResult = new RichTextBox();
|
||||||
|
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
|
||||||
this.BackColor = Color.FromArgb(24, 25, 32);
|
this.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.Dock = DockStyle.Fill;
|
this.Dock = DockStyle.Fill;
|
||||||
this.Padding = new Padding(12);
|
this.Padding = new Padding(12);
|
||||||
|
|
||||||
|
// Left panel
|
||||||
this.pnlLeft.Dock = DockStyle.Left;
|
this.pnlLeft.Dock = DockStyle.Left;
|
||||||
this.pnlLeft.Width = 445;
|
this.pnlLeft.Width = 470;
|
||||||
this.pnlLeft.BackColor = Color.FromArgb(30, 32, 42);
|
this.pnlLeft.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
this.pnlLeft.Padding = new Padding(12);
|
this.pnlLeft.Padding = new Padding(12);
|
||||||
this.pnlLeft.AutoScroll = true;
|
this.pnlLeft.AutoScroll = true;
|
||||||
|
|
||||||
this.lblTitle.Text = "Matris Cebiri & Ayrıştırma Stüdyosu";
|
this.lblTitle.Text = "Matris Cebiri & Ayrıştırma Stüdyosu";
|
||||||
this.lblTitle.Font = new Font("Segoe UI", 12.5F, FontStyle.Bold);
|
this.lblTitle.Font = new Font("Segoe UI Semibold", 13F, FontStyle.Bold);
|
||||||
this.lblTitle.ForeColor = Color.White;
|
this.lblTitle.ForeColor = Color.White;
|
||||||
this.lblTitle.Location = new Point(12, 10);
|
this.lblTitle.Location = new Point(12, 10);
|
||||||
this.lblTitle.AutoSize = true;
|
this.lblTitle.AutoSize = true;
|
||||||
|
|
||||||
this.lblDesc.Text = "A ve B matrisleri üzerinde cebir, AX=B sistemleri ve LU/QR/SVD ayrıştırmaları.";
|
this.lblDesc.Text = "A ve B matrisleri üzerinde analitik doğrusal cebir, LU/QR/SVD/Cholesky ayrıştırmaları ve AX=B sistem çözücüsü.";
|
||||||
this.lblDesc.Font = new Font("Segoe UI", 8.5F);
|
this.lblDesc.Font = new Font("Segoe UI", 8.5F);
|
||||||
this.lblDesc.ForeColor = Color.FromArgb(165, 175, 195);
|
this.lblDesc.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
this.lblDesc.Location = new Point(12, 34);
|
this.lblDesc.Location = new Point(12, 34);
|
||||||
this.lblDesc.Size = new Size(415, 18);
|
this.lblDesc.Size = new Size(440, 28);
|
||||||
|
|
||||||
// --- MATRIX A ---
|
// ================== CARD A ==================
|
||||||
this.lblHeaderA.Text = "A Matrisi (m × n):";
|
this.pnlCardA.Location = new Point(12, 66);
|
||||||
this.lblHeaderA.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
|
this.pnlCardA.Size = new Size(440, 165);
|
||||||
this.lblHeaderA.ForeColor = Color.FromArgb(110, 190, 255);
|
this.pnlCardA.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
this.lblHeaderA.Location = new Point(12, 56);
|
this.pnlCardA.Padding = new Padding(8);
|
||||||
|
|
||||||
|
this.lblHeaderA.Text = "A Matrisi:";
|
||||||
|
this.lblHeaderA.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
||||||
|
this.lblHeaderA.ForeColor = Color.FromArgb(56, 189, 248);
|
||||||
|
this.lblHeaderA.Location = new Point(8, 8);
|
||||||
this.lblHeaderA.AutoSize = true;
|
this.lblHeaderA.AutoSize = true;
|
||||||
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRowsA)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numRowsA)).BeginInit();
|
||||||
this.numRowsA.Location = new Point(130, 54);
|
this.numRowsA.Location = new Point(80, 6);
|
||||||
this.numRowsA.Minimum = 1;
|
this.numRowsA.Minimum = 1;
|
||||||
this.numRowsA.Maximum = 6;
|
this.numRowsA.Maximum = 8;
|
||||||
this.numRowsA.Value = 3;
|
this.numRowsA.Value = 3;
|
||||||
this.numRowsA.Size = new Size(38, 24);
|
this.numRowsA.Size = new Size(38, 24);
|
||||||
this.numRowsA.BackColor = Color.FromArgb(40, 43, 56);
|
this.numRowsA.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.numRowsA.ForeColor = Color.White;
|
this.numRowsA.ForeColor = Color.White;
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRowsA)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numRowsA)).EndInit();
|
||||||
|
|
||||||
|
this.lblTimesA.Text = "×";
|
||||||
|
this.lblTimesA.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
this.lblTimesA.Location = new Point(120, 8);
|
||||||
|
this.lblTimesA.AutoSize = true;
|
||||||
|
this.lblTimesA.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
|
||||||
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numColsA)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numColsA)).BeginInit();
|
||||||
this.numColsA.Location = new Point(172, 54);
|
this.numColsA.Location = new Point(134, 6);
|
||||||
this.numColsA.Minimum = 1;
|
this.numColsA.Minimum = 1;
|
||||||
this.numColsA.Maximum = 6;
|
this.numColsA.Maximum = 8;
|
||||||
this.numColsA.Value = 3;
|
this.numColsA.Value = 3;
|
||||||
this.numColsA.Size = new Size(38, 24);
|
this.numColsA.Size = new Size(38, 24);
|
||||||
this.numColsA.BackColor = Color.FromArgb(40, 43, 56);
|
this.numColsA.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.numColsA.ForeColor = Color.White;
|
this.numColsA.ForeColor = Color.White;
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numColsA)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numColsA)).EndInit();
|
||||||
|
|
||||||
StyleSmallBtn(btnResizeA, "Boyutla", new Point(214, 53), new Size(54, 25));
|
StyleSmallBtn(btnResizeA, "Boyutla", new Point(176, 5), new Size(54, 25));
|
||||||
StyleSmallBtn(btnRandomA, "Rastgele", new Point(272, 53), new Size(58, 25));
|
StyleSmallBtn(btnRandomA, "Rastgele", new Point(233, 5), new Size(58, 25));
|
||||||
StyleSmallBtn(btnIdentityA, "I", new Point(334, 53), new Size(34, 25));
|
StyleSmallBtn(btnIdentityA, "I", new Point(294, 5), new Size(28, 25));
|
||||||
StyleSmallBtn(btnZeroA, "0", new Point(372, 53), new Size(34, 25));
|
StyleSmallBtn(btnZeroA, "0", new Point(325, 5), new Size(28, 25));
|
||||||
|
StyleSmallBtn(btnSpdA, "SPD", new Point(356, 5), new Size(40, 25));
|
||||||
|
StyleSmallBtn(btnPasteA, "📋", new Point(399, 5), new Size(33, 25));
|
||||||
|
|
||||||
this.pnlGridA.Location = new Point(12, 82);
|
SetupDataGridView(this.dgvMatrixA, new Point(8, 35), new Size(424, 122));
|
||||||
this.pnlGridA.Size = new Size(410, 118);
|
|
||||||
this.pnlGridA.BackColor = Color.FromArgb(24, 26, 34);
|
|
||||||
this.pnlGridA.AutoScroll = true;
|
|
||||||
|
|
||||||
// --- MATRIX B ---
|
this.pnlCardA.Controls.Add(this.lblHeaderA);
|
||||||
this.lblHeaderB.Text = "B Matrisi (Sağ Taraf):";
|
this.pnlCardA.Controls.Add(this.numRowsA);
|
||||||
this.lblHeaderB.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
|
this.pnlCardA.Controls.Add(this.lblTimesA);
|
||||||
this.lblHeaderB.ForeColor = Color.FromArgb(140, 225, 175);
|
this.pnlCardA.Controls.Add(this.numColsA);
|
||||||
this.lblHeaderB.Location = new Point(12, 206);
|
this.pnlCardA.Controls.Add(this.btnResizeA);
|
||||||
|
this.pnlCardA.Controls.Add(this.btnRandomA);
|
||||||
|
this.pnlCardA.Controls.Add(this.btnIdentityA);
|
||||||
|
this.pnlCardA.Controls.Add(this.btnZeroA);
|
||||||
|
this.pnlCardA.Controls.Add(this.btnSpdA);
|
||||||
|
this.pnlCardA.Controls.Add(this.btnPasteA);
|
||||||
|
this.pnlCardA.Controls.Add(this.dgvMatrixA);
|
||||||
|
|
||||||
|
// ================== CARD B ==================
|
||||||
|
this.pnlCardB.Location = new Point(12, 237);
|
||||||
|
this.pnlCardB.Size = new Size(440, 165);
|
||||||
|
this.pnlCardB.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.pnlCardB.Padding = new Padding(8);
|
||||||
|
|
||||||
|
this.lblHeaderB.Text = "B Matrisi:";
|
||||||
|
this.lblHeaderB.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
||||||
|
this.lblHeaderB.ForeColor = Color.FromArgb(52, 211, 153);
|
||||||
|
this.lblHeaderB.Location = new Point(8, 8);
|
||||||
this.lblHeaderB.AutoSize = true;
|
this.lblHeaderB.AutoSize = true;
|
||||||
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRowsB)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numRowsB)).BeginInit();
|
||||||
this.numRowsB.Location = new Point(130, 204);
|
this.numRowsB.Location = new Point(80, 6);
|
||||||
this.numRowsB.Minimum = 1;
|
this.numRowsB.Minimum = 1;
|
||||||
this.numRowsB.Maximum = 6;
|
this.numRowsB.Maximum = 8;
|
||||||
this.numRowsB.Value = 3;
|
this.numRowsB.Value = 3;
|
||||||
this.numRowsB.Size = new Size(38, 24);
|
this.numRowsB.Size = new Size(38, 24);
|
||||||
this.numRowsB.BackColor = Color.FromArgb(40, 43, 56);
|
this.numRowsB.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.numRowsB.ForeColor = Color.White;
|
this.numRowsB.ForeColor = Color.White;
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numRowsB)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numRowsB)).EndInit();
|
||||||
|
|
||||||
|
this.lblTimesB.Text = "×";
|
||||||
|
this.lblTimesB.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
this.lblTimesB.Location = new Point(120, 8);
|
||||||
|
this.lblTimesB.AutoSize = true;
|
||||||
|
this.lblTimesB.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
|
||||||
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numColsB)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numColsB)).BeginInit();
|
||||||
this.numColsB.Location = new Point(172, 204);
|
this.numColsB.Location = new Point(134, 6);
|
||||||
this.numColsB.Minimum = 1;
|
this.numColsB.Minimum = 1;
|
||||||
this.numColsB.Maximum = 6;
|
this.numColsB.Maximum = 8;
|
||||||
this.numColsB.Value = 3;
|
this.numColsB.Value = 3;
|
||||||
this.numColsB.Size = new Size(38, 24);
|
this.numColsB.Size = new Size(38, 24);
|
||||||
this.numColsB.BackColor = Color.FromArgb(40, 43, 56);
|
this.numColsB.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.numColsB.ForeColor = Color.White;
|
this.numColsB.ForeColor = Color.White;
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numColsB)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numColsB)).EndInit();
|
||||||
|
|
||||||
StyleSmallBtn(btnResizeB, "Boyutla", new Point(214, 203), new Size(54, 25));
|
StyleSmallBtn(btnResizeB, "Boyutla", new Point(176, 5), new Size(54, 25));
|
||||||
StyleSmallBtn(btnRandomB, "Rastgele", new Point(272, 203), new Size(58, 25));
|
StyleSmallBtn(btnRandomB, "Rastgele", new Point(233, 5), new Size(58, 25));
|
||||||
StyleSmallBtn(btnIdentityB, "I", new Point(334, 203), new Size(34, 25));
|
StyleSmallBtn(btnIdentityB, "I", new Point(294, 5), new Size(28, 25));
|
||||||
StyleSmallBtn(btnZeroB, "0", new Point(372, 203), new Size(34, 25));
|
StyleSmallBtn(btnZeroB, "0", new Point(325, 5), new Size(28, 25));
|
||||||
|
StyleSmallBtn(btnCopyAToB, "A→B", new Point(356, 5), new Size(40, 25));
|
||||||
|
StyleSmallBtn(btnPasteB, "📋", new Point(399, 5), new Size(33, 25));
|
||||||
|
|
||||||
this.pnlGridB.Location = new Point(12, 232);
|
SetupDataGridView(this.dgvMatrixB, new Point(8, 35), new Size(424, 122));
|
||||||
this.pnlGridB.Size = new Size(410, 118);
|
|
||||||
this.pnlGridB.BackColor = Color.FromArgb(24, 26, 34);
|
this.pnlCardB.Controls.Add(this.lblHeaderB);
|
||||||
this.pnlGridB.AutoScroll = true;
|
this.pnlCardB.Controls.Add(this.numRowsB);
|
||||||
|
this.pnlCardB.Controls.Add(this.lblTimesB);
|
||||||
|
this.pnlCardB.Controls.Add(this.numColsB);
|
||||||
|
this.pnlCardB.Controls.Add(this.btnResizeB);
|
||||||
|
this.pnlCardB.Controls.Add(this.btnRandomB);
|
||||||
|
this.pnlCardB.Controls.Add(this.btnIdentityB);
|
||||||
|
this.pnlCardB.Controls.Add(this.btnZeroB);
|
||||||
|
this.pnlCardB.Controls.Add(this.btnCopyAToB);
|
||||||
|
this.pnlCardB.Controls.Add(this.btnPasteB);
|
||||||
|
this.pnlCardB.Controls.Add(this.dgvMatrixB);
|
||||||
|
|
||||||
|
// ================== PRESETS & SCALAR ==================
|
||||||
|
this.pnlScalarPreset.Location = new Point(12, 408);
|
||||||
|
this.pnlScalarPreset.Size = new Size(440, 36);
|
||||||
|
this.pnlScalarPreset.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
|
|
||||||
// --- SCALAR & PRESETS ---
|
|
||||||
this.lblScalar.Text = "Skaler k:";
|
this.lblScalar.Text = "Skaler k:";
|
||||||
this.lblScalar.Font = new Font("Segoe UI", 8.5F, FontStyle.Bold);
|
this.lblScalar.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
this.lblScalar.ForeColor = Color.FromArgb(190, 200, 215);
|
this.lblScalar.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
this.lblScalar.Location = new Point(12, 358);
|
this.lblScalar.Location = new Point(2, 9);
|
||||||
this.lblScalar.AutoSize = true;
|
this.lblScalar.AutoSize = true;
|
||||||
|
|
||||||
this.txtScalar.Location = new Point(68, 355);
|
this.txtScalar.Location = new Point(56, 6);
|
||||||
this.txtScalar.Size = new Size(46, 24);
|
this.txtScalar.Size = new Size(44, 24);
|
||||||
this.txtScalar.BackColor = Color.FromArgb(40, 43, 56);
|
this.txtScalar.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.txtScalar.ForeColor = Color.White;
|
this.txtScalar.ForeColor = Color.White;
|
||||||
this.txtScalar.BorderStyle = BorderStyle.FixedSingle;
|
this.txtScalar.BorderStyle = BorderStyle.FixedSingle;
|
||||||
this.txtScalar.Text = "2.5";
|
this.txtScalar.Text = "2.5";
|
||||||
|
this.txtScalar.TextAlign = HorizontalAlignment.Center;
|
||||||
|
|
||||||
StyleSmallBtn(btnCopyAToB, "A→B Kopyala", new Point(118, 354), new Size(88, 25));
|
StyleSmallBtn(btnSwapAB, "A ↔ B Takas", new Point(106, 5), new Size(88, 25));
|
||||||
StyleSmallBtn(btnExSPD, "Örnek SPD", new Point(210, 354), new Size(96, 25));
|
StyleSmallBtn(btnExSPD, "Örnek SPD", new Point(198, 5), new Size(76, 25));
|
||||||
StyleSmallBtn(btnExGeneral, "Örnek Genel", new Point(310, 354), new Size(98, 25));
|
StyleSmallBtn(btnExGeneral, "Örnek Genel", new Point(278, 5), new Size(80, 25));
|
||||||
|
StyleSmallBtn(btnExOrthogonal, "Ortogonal", new Point(362, 5), new Size(72, 25));
|
||||||
|
|
||||||
// --- A OPERATIONS ---
|
this.pnlScalarPreset.Controls.Add(this.lblScalar);
|
||||||
this.lblOpsA.Text = "A Matrisi Analiz & Ayrıştırma (LU, QR, SVD, Cholesky, Özdeğer):";
|
this.pnlScalarPreset.Controls.Add(this.txtScalar);
|
||||||
this.lblOpsA.Font = new Font("Segoe UI", 8.5F, FontStyle.Bold);
|
this.pnlScalarPreset.Controls.Add(this.btnSwapAB);
|
||||||
this.lblOpsA.ForeColor = Color.FromArgb(180, 195, 220);
|
this.pnlScalarPreset.Controls.Add(this.btnExSPD);
|
||||||
this.lblOpsA.Location = new Point(12, 384);
|
this.pnlScalarPreset.Controls.Add(this.btnExGeneral);
|
||||||
this.lblOpsA.AutoSize = true;
|
this.pnlScalarPreset.Controls.Add(this.btnExOrthogonal);
|
||||||
|
|
||||||
this.btnAllProps.Text = "📊 A Matrisi Tam Analiz (Det, Rank, Norm2, Kondisyon, Tersi)";
|
// ================== TABBED OPERATIONS ==================
|
||||||
this.btnAllProps.Location = new Point(12, 403);
|
this.tabOperations.Location = new Point(12, 448);
|
||||||
this.btnAllProps.Size = new Size(410, 30);
|
this.tabOperations.Size = new Size(440, 230);
|
||||||
this.btnAllProps.BackColor = Color.FromArgb(46, 125, 225);
|
this.tabOperations.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
|
|
||||||
|
// TAB 1: Tekil Analiz
|
||||||
|
this.tabUnary.Text = "Tekil Analiz (A)";
|
||||||
|
this.tabUnary.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabUnary.Padding = new Padding(8);
|
||||||
|
|
||||||
|
this.btnAllProps.Text = "📊 A Matrisi Tam Analizi (Det, Rank, İz, Normlar, Kondisyon)";
|
||||||
|
this.btnAllProps.Location = new Point(8, 8);
|
||||||
|
this.btnAllProps.Size = new Size(418, 32);
|
||||||
|
this.btnAllProps.BackColor = Color.FromArgb(37, 99, 235);
|
||||||
this.btnAllProps.ForeColor = Color.White;
|
this.btnAllProps.ForeColor = Color.White;
|
||||||
this.btnAllProps.FlatStyle = FlatStyle.Flat;
|
this.btnAllProps.FlatStyle = FlatStyle.Flat;
|
||||||
this.btnAllProps.FlatAppearance.BorderSize = 0;
|
this.btnAllProps.FlatAppearance.BorderSize = 0;
|
||||||
this.btnAllProps.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
|
this.btnAllProps.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
this.btnAllProps.Cursor = Cursors.Hand;
|
this.btnAllProps.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
StyleOpBtn(btnLU, "LU Ayrıştırma", new Point(12, 437), new Size(132, 27));
|
StyleOpBtn(btnInverse, "Ters Matris (A⁻¹)", new Point(8, 46), new Size(135, 30));
|
||||||
StyleOpBtn(btnQR, "QR & Householder", new Point(150, 437), new Size(134, 27));
|
StyleOpBtn(btnTranspose, "Transpoz (Aᵀ)", new Point(149, 46), new Size(135, 30));
|
||||||
StyleOpBtn(btnCholesky, "Cholesky (LLᵀ)", new Point(290, 437), new Size(132, 27));
|
StyleOpBtn(btnUnaryMinus, "Negatifi (-A)", new Point(290, 46), new Size(136, 30));
|
||||||
StyleOpBtn(btnSVD, "SVD (U·Σ·Vᵀ)", new Point(12, 467), new Size(132, 27));
|
|
||||||
StyleOpBtn(btnEigen, "Özdeğer (λ, V)", new Point(150, 467), new Size(134, 27));
|
|
||||||
StyleOpBtn(btnInverse, "Ters & Transpoz", new Point(290, 467), new Size(132, 27));
|
|
||||||
|
|
||||||
// --- A & B BINARY OPERATIONS ---
|
StyleOpBtn(btnTraceDet, "İz & Determinant", new Point(8, 82), new Size(135, 30));
|
||||||
this.lblOpsAB.Text = "İki Matrisli Cebir (A ve B) & Matris Denklem Çözücü:";
|
StyleOpBtn(btnNorms, "Matris Normları (1, 2, ∞, F)", new Point(149, 82), new Size(277, 30));
|
||||||
this.lblOpsAB.Font = new Font("Segoe UI", 8.5F, FontStyle.Bold);
|
|
||||||
this.lblOpsAB.ForeColor = Color.FromArgb(140, 225, 175);
|
|
||||||
this.lblOpsAB.Location = new Point(12, 498);
|
|
||||||
this.lblOpsAB.AutoSize = true;
|
|
||||||
|
|
||||||
StyleBinaryBtn(btnAddAB, "A + B", new Point(12, 517), new Size(98, 27));
|
StyleOpBtn(btnCondRank, "Kondisyon Sayısı κ(A) & Rank", new Point(8, 118), new Size(418, 30));
|
||||||
StyleBinaryBtn(btnSubAB, "A - B", new Point(116, 517), new Size(98, 27));
|
|
||||||
StyleBinaryBtn(btnMulAB, "A × B (Çarpım)", new Point(220, 517), new Size(98, 27));
|
|
||||||
StyleBinaryBtn(btnScalarMul, "k · A", new Point(324, 517), new Size(98, 27));
|
|
||||||
|
|
||||||
StyleBinaryBtn(btnElemMul, "A .* B (Hadamard)", new Point(12, 547), new Size(132, 27));
|
this.tabUnary.Controls.Add(this.btnAllProps);
|
||||||
StyleBinaryBtn(btnElemDiv, "A ./ B (Eleman Böl)", new Point(150, 547), new Size(134, 27));
|
this.tabUnary.Controls.Add(this.btnInverse);
|
||||||
StyleBinaryBtn(btnSolveAXB, "Çöz: A·X = B", new Point(290, 547), new Size(132, 27));
|
this.tabUnary.Controls.Add(this.btnTranspose);
|
||||||
|
this.tabUnary.Controls.Add(this.btnUnaryMinus);
|
||||||
|
this.tabUnary.Controls.Add(this.btnTraceDet);
|
||||||
|
this.tabUnary.Controls.Add(this.btnNorms);
|
||||||
|
this.tabUnary.Controls.Add(this.btnCondRank);
|
||||||
|
|
||||||
this.btnSolveTrans.Text = "Transpoz Denklem Çözücü: Aᵀ · Xᵀ = Bᵀ (SolveTranspose)";
|
// TAB 2: Ayrıştırmalar
|
||||||
this.btnSolveTrans.Location = new Point(12, 577);
|
this.tabDecomp.Text = "Ayrıştırmalar";
|
||||||
this.btnSolveTrans.Size = new Size(410, 27);
|
this.tabDecomp.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
this.btnSolveTrans.BackColor = Color.FromArgb(38, 85, 78);
|
this.tabDecomp.Padding = new Padding(8);
|
||||||
this.btnSolveTrans.ForeColor = Color.White;
|
|
||||||
this.btnSolveTrans.FlatStyle = FlatStyle.Flat;
|
StyleOpBtn(btnLU, "LU Ayrışımı (P·A = L·U)", new Point(8, 10), new Size(205, 32));
|
||||||
this.btnSolveTrans.FlatAppearance.BorderSize = 0;
|
StyleOpBtn(btnQR, "QR Ayrışımı (Householder)", new Point(221, 10), new Size(205, 32));
|
||||||
this.btnSolveTrans.Font = new Font("Segoe UI", 8.5F, FontStyle.Bold);
|
StyleOpBtn(btnCholesky, "Cholesky (A = L·Lᵀ)", new Point(8, 48), new Size(205, 32));
|
||||||
this.btnSolveTrans.Cursor = Cursors.Hand;
|
StyleOpBtn(btnSVD, "SVD (A = U·Σ·Vᵀ)", new Point(221, 48), new Size(205, 32));
|
||||||
|
StyleOpBtn(btnEigen, "Özdeğerler & Özvektörler (A·v = λ·v)", new Point(8, 86), new Size(418, 32));
|
||||||
|
|
||||||
|
this.tabDecomp.Controls.Add(this.btnLU);
|
||||||
|
this.tabDecomp.Controls.Add(this.btnQR);
|
||||||
|
this.tabDecomp.Controls.Add(this.btnCholesky);
|
||||||
|
this.tabDecomp.Controls.Add(this.btnSVD);
|
||||||
|
this.tabDecomp.Controls.Add(this.btnEigen);
|
||||||
|
|
||||||
|
// TAB 3: İki Matrisli & Denklem Çözücü
|
||||||
|
this.tabBinary.Text = "İki Matrisli & Denklem";
|
||||||
|
this.tabBinary.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabBinary.Padding = new Padding(8);
|
||||||
|
|
||||||
|
StyleBinaryBtn(btnAddAB, "A + B", new Point(8, 10), new Size(100, 30));
|
||||||
|
StyleBinaryBtn(btnSubAB, "A - B", new Point(114, 10), new Size(100, 30));
|
||||||
|
StyleBinaryBtn(btnMulAB, "A × B (Çarpım)", new Point(220, 10), new Size(100, 30));
|
||||||
|
StyleBinaryBtn(btnScalarMul, "k · A", new Point(326, 10), new Size(100, 30));
|
||||||
|
|
||||||
|
StyleBinaryBtn(btnElemMul, "A .* B (Hadamard)", new Point(8, 46), new Size(206, 30));
|
||||||
|
StyleBinaryBtn(btnElemDiv, "A ./ B (Noktasal Böl)", new Point(220, 46), new Size(206, 30));
|
||||||
|
|
||||||
|
StyleBinaryBtn(btnSolveAXB, "Lineer Sistem Çöz: A · X = B", new Point(8, 82), new Size(418, 32));
|
||||||
|
StyleBinaryBtn(btnSolveTrans, "Transpoz Çözücü: Aᵀ · Xᵀ = Bᵀ", new Point(8, 120), new Size(418, 32));
|
||||||
|
|
||||||
|
this.tabBinary.Controls.Add(this.btnAddAB);
|
||||||
|
this.tabBinary.Controls.Add(this.btnSubAB);
|
||||||
|
this.tabBinary.Controls.Add(this.btnMulAB);
|
||||||
|
this.tabBinary.Controls.Add(this.btnScalarMul);
|
||||||
|
this.tabBinary.Controls.Add(this.btnElemMul);
|
||||||
|
this.tabBinary.Controls.Add(this.btnElemDiv);
|
||||||
|
this.tabBinary.Controls.Add(this.btnSolveAXB);
|
||||||
|
this.tabBinary.Controls.Add(this.btnSolveTrans);
|
||||||
|
|
||||||
|
this.tabOperations.TabPages.Add(this.tabUnary);
|
||||||
|
this.tabOperations.TabPages.Add(this.tabDecomp);
|
||||||
|
this.tabOperations.TabPages.Add(this.tabBinary);
|
||||||
|
|
||||||
this.pnlLeft.Controls.Add(this.lblTitle);
|
this.pnlLeft.Controls.Add(this.lblTitle);
|
||||||
this.pnlLeft.Controls.Add(this.lblDesc);
|
this.pnlLeft.Controls.Add(this.lblDesc);
|
||||||
this.pnlLeft.Controls.Add(this.lblHeaderA);
|
this.pnlLeft.Controls.Add(this.pnlCardA);
|
||||||
this.pnlLeft.Controls.Add(this.numRowsA);
|
this.pnlLeft.Controls.Add(this.pnlCardB);
|
||||||
this.pnlLeft.Controls.Add(this.numColsA);
|
this.pnlLeft.Controls.Add(this.pnlScalarPreset);
|
||||||
this.pnlLeft.Controls.Add(this.btnResizeA);
|
this.pnlLeft.Controls.Add(this.tabOperations);
|
||||||
this.pnlLeft.Controls.Add(this.btnRandomA);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnIdentityA);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnZeroA);
|
|
||||||
this.pnlLeft.Controls.Add(this.pnlGridA);
|
|
||||||
|
|
||||||
this.pnlLeft.Controls.Add(this.lblHeaderB);
|
// ================== RIGHT PANEL ==================
|
||||||
this.pnlLeft.Controls.Add(this.numRowsB);
|
|
||||||
this.pnlLeft.Controls.Add(this.numColsB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnResizeB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnRandomB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnIdentityB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnZeroB);
|
|
||||||
this.pnlLeft.Controls.Add(this.pnlGridB);
|
|
||||||
|
|
||||||
this.pnlLeft.Controls.Add(this.lblScalar);
|
|
||||||
this.pnlLeft.Controls.Add(this.txtScalar);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnCopyAToB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnExSPD);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnExGeneral);
|
|
||||||
|
|
||||||
this.pnlLeft.Controls.Add(this.lblOpsA);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnAllProps);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnLU);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnQR);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnCholesky);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnSVD);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnEigen);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnInverse);
|
|
||||||
|
|
||||||
this.pnlLeft.Controls.Add(this.lblOpsAB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnAddAB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnSubAB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnMulAB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnScalarMul);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnElemMul);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnElemDiv);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnSolveAXB);
|
|
||||||
this.pnlLeft.Controls.Add(this.btnSolveTrans);
|
|
||||||
|
|
||||||
// Right Pane with Toolbar
|
|
||||||
this.pnlRight.Dock = DockStyle.Fill;
|
this.pnlRight.Dock = DockStyle.Fill;
|
||||||
this.pnlRight.Padding = new Padding(12, 0, 0, 0);
|
this.pnlRight.Padding = new Padding(12, 0, 0, 0);
|
||||||
|
|
||||||
|
// KPI Container
|
||||||
|
this.pnlKpiContainer.Dock = DockStyle.Top;
|
||||||
|
this.pnlKpiContainer.Height = 56;
|
||||||
|
this.pnlKpiContainer.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
|
this.pnlKpiContainer.Padding = new Padding(0, 0, 0, 8);
|
||||||
|
|
||||||
|
this.pnlKpiDet = CreateKpiCard("det(A)", "—", Color.FromArgb(56, 189, 248), out this.lblKpiDetTitle, out this.lblKpiDetVal);
|
||||||
|
this.pnlKpiDet.Dock = DockStyle.Left;
|
||||||
|
this.pnlKpiDet.Width = 140;
|
||||||
|
|
||||||
|
this.pnlKpiRank = CreateKpiCard("rank(A)", "—", Color.FromArgb(52, 211, 153), out this.lblKpiRankTitle, out this.lblKpiRankVal);
|
||||||
|
this.pnlKpiRank.Dock = DockStyle.Left;
|
||||||
|
this.pnlKpiRank.Width = 140;
|
||||||
|
|
||||||
|
this.pnlKpiCond = CreateKpiCard("kondisyon κ(A)", "—", Color.FromArgb(251, 191, 36), out this.lblKpiCondTitle, out this.lblKpiCondVal);
|
||||||
|
this.pnlKpiCond.Dock = DockStyle.Left;
|
||||||
|
this.pnlKpiCond.Width = 160;
|
||||||
|
|
||||||
|
this.pnlKpiContainer.Controls.Add(this.pnlKpiCond);
|
||||||
|
this.pnlKpiContainer.Controls.Add(this.pnlKpiRank);
|
||||||
|
this.pnlKpiContainer.Controls.Add(this.pnlKpiDet);
|
||||||
|
|
||||||
|
// Result Toolbar
|
||||||
this.pnlResultToolbar.Dock = DockStyle.Top;
|
this.pnlResultToolbar.Dock = DockStyle.Top;
|
||||||
this.pnlResultToolbar.Height = 36;
|
this.pnlResultToolbar.Height = 36;
|
||||||
this.pnlResultToolbar.BackColor = Color.FromArgb(24, 25, 32);
|
this.pnlResultToolbar.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
|
|
||||||
this.lblResultTitle.Text = "📊 Matris Analiz & İşlem Çıktısı:";
|
this.lblResultTitle.Text = "📊 Matris Analiz & Ayrıştırma Çıktısı:";
|
||||||
this.lblResultTitle.Dock = DockStyle.Left;
|
this.lblResultTitle.Dock = DockStyle.Left;
|
||||||
this.lblResultTitle.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
this.lblResultTitle.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
||||||
this.lblResultTitle.ForeColor = ThemeHelper.LightText;
|
this.lblResultTitle.ForeColor = ThemeHelper.LightText;
|
||||||
this.lblResultTitle.TextAlign = ContentAlignment.MiddleLeft;
|
this.lblResultTitle.TextAlign = ContentAlignment.MiddleLeft;
|
||||||
|
this.lblResultTitle.Padding = new Padding(8, 0, 0, 0);
|
||||||
|
|
||||||
this.btnAnsToA.Text = "📥 Sonucu Matris A'ya Aktar (Ans→A)";
|
this.btnAnsToA.Text = "📥 Ans → A";
|
||||||
this.btnAnsToA.Dock = DockStyle.Right;
|
this.btnAnsToA.Dock = DockStyle.Right;
|
||||||
this.btnAnsToA.Width = 220;
|
this.btnAnsToA.Width = 100;
|
||||||
this.btnAnsToA.FlatStyle = FlatStyle.Flat;
|
this.btnAnsToA.FlatStyle = FlatStyle.Flat;
|
||||||
this.btnAnsToA.BackColor = Color.FromArgb(37, 99, 235);
|
this.btnAnsToA.BackColor = Color.FromArgb(37, 99, 235);
|
||||||
this.btnAnsToA.ForeColor = Color.White;
|
this.btnAnsToA.ForeColor = Color.White;
|
||||||
|
|
@ -363,6 +514,26 @@ namespace MathApp.Controls
|
||||||
this.btnAnsToA.FlatAppearance.BorderSize = 0;
|
this.btnAnsToA.FlatAppearance.BorderSize = 0;
|
||||||
this.btnAnsToA.Cursor = Cursors.Hand;
|
this.btnAnsToA.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
|
this.btnAnsToB.Text = "📥 Ans → B";
|
||||||
|
this.btnAnsToB.Dock = DockStyle.Right;
|
||||||
|
this.btnAnsToB.Width = 100;
|
||||||
|
this.btnAnsToB.FlatStyle = FlatStyle.Flat;
|
||||||
|
this.btnAnsToB.BackColor = Color.FromArgb(16, 185, 129);
|
||||||
|
this.btnAnsToB.ForeColor = Color.White;
|
||||||
|
this.btnAnsToB.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
|
this.btnAnsToB.FlatAppearance.BorderSize = 0;
|
||||||
|
this.btnAnsToB.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
|
this.btnCopyLatex.Text = "LaTeX Kopyala";
|
||||||
|
this.btnCopyLatex.Dock = DockStyle.Right;
|
||||||
|
this.btnCopyLatex.Width = 110;
|
||||||
|
this.btnCopyLatex.FlatStyle = FlatStyle.Flat;
|
||||||
|
this.btnCopyLatex.BackColor = ThemeHelper.ButtonSecondary;
|
||||||
|
this.btnCopyLatex.ForeColor = Color.FromArgb(186, 230, 253);
|
||||||
|
this.btnCopyLatex.Font = new Font("Segoe UI Semibold", 8.5F);
|
||||||
|
this.btnCopyLatex.FlatAppearance.BorderSize = 0;
|
||||||
|
this.btnCopyLatex.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
this.btnCopyMatrix.Text = "📋 Kopyala";
|
this.btnCopyMatrix.Text = "📋 Kopyala";
|
||||||
this.btnCopyMatrix.Dock = DockStyle.Right;
|
this.btnCopyMatrix.Dock = DockStyle.Right;
|
||||||
this.btnCopyMatrix.Width = 85;
|
this.btnCopyMatrix.Width = 85;
|
||||||
|
|
@ -374,31 +545,96 @@ namespace MathApp.Controls
|
||||||
this.btnCopyMatrix.Cursor = Cursors.Hand;
|
this.btnCopyMatrix.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
this.pnlResultToolbar.Controls.Add(this.lblResultTitle);
|
this.pnlResultToolbar.Controls.Add(this.lblResultTitle);
|
||||||
|
this.pnlResultToolbar.Controls.Add(this.btnCopyLatex);
|
||||||
this.pnlResultToolbar.Controls.Add(this.btnCopyMatrix);
|
this.pnlResultToolbar.Controls.Add(this.btnCopyMatrix);
|
||||||
|
this.pnlResultToolbar.Controls.Add(this.btnAnsToB);
|
||||||
this.pnlResultToolbar.Controls.Add(this.btnAnsToA);
|
this.pnlResultToolbar.Controls.Add(this.btnAnsToA);
|
||||||
|
|
||||||
this.txtResult.Dock = DockStyle.Fill;
|
this.txtResult.Dock = DockStyle.Fill;
|
||||||
this.txtResult.BackColor = Color.FromArgb(18, 19, 25);
|
this.txtResult.BackColor = Color.FromArgb(11, 15, 28);
|
||||||
this.txtResult.ForeColor = Color.FromArgb(225, 232, 245);
|
this.txtResult.ForeColor = Color.FromArgb(226, 232, 240);
|
||||||
this.txtResult.Font = new Font("Consolas", 10F);
|
this.txtResult.Font = new Font("Consolas", 10F);
|
||||||
this.txtResult.BorderStyle = BorderStyle.None;
|
this.txtResult.BorderStyle = BorderStyle.None;
|
||||||
this.txtResult.ReadOnly = true;
|
this.txtResult.ReadOnly = true;
|
||||||
|
this.txtResult.WordWrap = false;
|
||||||
|
|
||||||
this.pnlRight.Controls.Add(this.txtResult);
|
this.pnlRight.Controls.Add(this.txtResult);
|
||||||
this.pnlRight.Controls.Add(this.pnlResultToolbar);
|
this.pnlRight.Controls.Add(this.pnlResultToolbar);
|
||||||
|
this.pnlRight.Controls.Add(this.pnlKpiContainer);
|
||||||
|
|
||||||
this.Controls.Add(this.pnlRight);
|
this.Controls.Add(this.pnlRight);
|
||||||
this.Controls.Add(this.pnlLeft);
|
this.Controls.Add(this.pnlLeft);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Panel CreateKpiCard(string title, string defVal, Color accent, out Label lblTitle, out Label lblVal)
|
||||||
|
{
|
||||||
|
Panel p = new Panel
|
||||||
|
{
|
||||||
|
BackColor = Color.FromArgb(24, 33, 52),
|
||||||
|
Margin = new Padding(0, 0, 8, 0),
|
||||||
|
Padding = new Padding(10, 4, 10, 4)
|
||||||
|
};
|
||||||
|
|
||||||
|
lblTitle = new Label
|
||||||
|
{
|
||||||
|
Text = title,
|
||||||
|
Font = new Font("Segoe UI Semibold", 7.5F, FontStyle.Bold),
|
||||||
|
ForeColor = Color.FromArgb(148, 163, 184),
|
||||||
|
Dock = DockStyle.Top,
|
||||||
|
Height = 16
|
||||||
|
};
|
||||||
|
|
||||||
|
lblVal = new Label
|
||||||
|
{
|
||||||
|
Text = defVal,
|
||||||
|
Font = new Font("Consolas", 11.5F, FontStyle.Bold),
|
||||||
|
ForeColor = accent,
|
||||||
|
Dock = DockStyle.Fill,
|
||||||
|
TextAlign = ContentAlignment.MiddleLeft
|
||||||
|
};
|
||||||
|
|
||||||
|
p.Controls.Add(lblVal);
|
||||||
|
p.Controls.Add(lblTitle);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupDataGridView(DataGridView dgv, Point loc, Size sz)
|
||||||
|
{
|
||||||
|
dgv.Location = loc;
|
||||||
|
dgv.Size = sz;
|
||||||
|
dgv.BackgroundColor = Color.FromArgb(15, 23, 42);
|
||||||
|
dgv.BorderStyle = BorderStyle.None;
|
||||||
|
dgv.EnableHeadersVisualStyles = false;
|
||||||
|
dgv.AllowUserToAddRows = false;
|
||||||
|
dgv.AllowUserToDeleteRows = false;
|
||||||
|
dgv.AllowUserToResizeRows = false;
|
||||||
|
dgv.RowHeadersWidth = 38;
|
||||||
|
dgv.RowHeadersDefaultCellStyle.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
dgv.RowHeadersDefaultCellStyle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
dgv.RowHeadersDefaultCellStyle.Font = new Font("Segoe UI", 8F);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold);
|
||||||
|
dgv.ColumnHeadersHeight = 22;
|
||||||
|
dgv.DefaultCellStyle.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
|
dgv.DefaultCellStyle.ForeColor = Color.White;
|
||||||
|
dgv.DefaultCellStyle.Font = new Font("Consolas", 9.5F, FontStyle.Bold);
|
||||||
|
dgv.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||||
|
dgv.DefaultCellStyle.SelectionBackColor = Color.FromArgb(37, 99, 235);
|
||||||
|
dgv.DefaultCellStyle.SelectionForeColor = Color.White;
|
||||||
|
dgv.GridColor = Color.FromArgb(40, 50, 75);
|
||||||
|
dgv.SelectionMode = DataGridViewSelectionMode.CellSelect;
|
||||||
|
dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
}
|
||||||
|
|
||||||
private void StyleSmallBtn(Button b, string text, Point loc, Size sz)
|
private void StyleSmallBtn(Button b, string text, Point loc, Size sz)
|
||||||
{
|
{
|
||||||
b.Text = text;
|
b.Text = text;
|
||||||
b.Location = loc;
|
b.Location = loc;
|
||||||
b.Size = sz;
|
b.Size = sz;
|
||||||
b.BackColor = Color.FromArgb(45, 50, 68);
|
b.BackColor = Color.FromArgb(33, 44, 70);
|
||||||
b.ForeColor = Color.FromArgb(215, 225, 245);
|
b.ForeColor = Color.FromArgb(226, 232, 240);
|
||||||
b.FlatStyle = FlatStyle.Flat;
|
b.FlatStyle = FlatStyle.Flat;
|
||||||
b.FlatAppearance.BorderSize = 0;
|
b.FlatAppearance.BorderSize = 0;
|
||||||
b.Font = new Font("Segoe UI", 8F);
|
b.Font = new Font("Segoe UI", 8F);
|
||||||
|
|
@ -410,11 +646,11 @@ namespace MathApp.Controls
|
||||||
b.Text = text;
|
b.Text = text;
|
||||||
b.Location = loc;
|
b.Location = loc;
|
||||||
b.Size = sz;
|
b.Size = sz;
|
||||||
b.BackColor = Color.FromArgb(52, 60, 84);
|
b.BackColor = Color.FromArgb(33, 44, 70);
|
||||||
b.ForeColor = Color.White;
|
b.ForeColor = Color.White;
|
||||||
b.FlatStyle = FlatStyle.Flat;
|
b.FlatStyle = FlatStyle.Flat;
|
||||||
b.FlatAppearance.BorderSize = 0;
|
b.FlatAppearance.BorderSize = 0;
|
||||||
b.Font = new Font("Segoe UI", 8.5F, FontStyle.Bold);
|
b.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
b.Cursor = Cursors.Hand;
|
b.Cursor = Cursors.Hand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,11 +659,11 @@ namespace MathApp.Controls
|
||||||
b.Text = text;
|
b.Text = text;
|
||||||
b.Location = loc;
|
b.Location = loc;
|
||||||
b.Size = sz;
|
b.Size = sz;
|
||||||
b.BackColor = Color.FromArgb(40, 95, 76);
|
b.BackColor = Color.FromArgb(15, 60, 48);
|
||||||
b.ForeColor = Color.White;
|
b.ForeColor = Color.FromArgb(220, 252, 231);
|
||||||
b.FlatStyle = FlatStyle.Flat;
|
b.FlatStyle = FlatStyle.Flat;
|
||||||
b.FlatAppearance.BorderSize = 0;
|
b.FlatAppearance.BorderSize = 0;
|
||||||
b.Font = new Font("Segoe UI", 8.5F, FontStyle.Bold);
|
b.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
b.Cursor = Cursors.Hand;
|
b.Cursor = Cursors.Hand;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -21,139 +21,327 @@ namespace MathApp.Controls
|
||||||
{
|
{
|
||||||
this.pnlHeader = ThemeHelper.CreateHeaderPanel(
|
this.pnlHeader = ThemeHelper.CreateHeaderPanel(
|
||||||
"Çok Değişkenli Taylor Serisi (Multivariable Taylor)",
|
"Çok Değişkenli Taylor Serisi (Multivariable Taylor)",
|
||||||
"f(x, y, ...) fonksiyonları için tüm kısmi ve çapraz (mixed partial) türevleri içeren tam çok değişkenli Taylor açılımı.");
|
"f(x, y, ...) fonksiyonları için tüm kısmi ve çapraz (mixed partial) türevleri içeren teğet düzlemi, Hessian formu ve tam Taylor açılımı.");
|
||||||
|
|
||||||
this.pnlContent = new Panel();
|
this.pnlContent = new Panel();
|
||||||
|
|
||||||
|
// Presets
|
||||||
this.pnlPresets = new FlowLayoutPanel();
|
this.pnlPresets = new FlowLayoutPanel();
|
||||||
this.lblPresets = new Label();
|
this.lblPresets = new Label();
|
||||||
this.btnEx1 = ThemeHelper.CreateExampleChip("Örnek 1: sin(x)*cos(y)");
|
this.btnEx1 = ThemeHelper.CreateExampleChip("sin(x)*cos(y) (0, 0)");
|
||||||
this.btnEx2 = ThemeHelper.CreateExampleChip("Örnek 2: exp(x + y)");
|
this.btnEx2 = ThemeHelper.CreateExampleChip("exp(x + y) (0, 0)");
|
||||||
this.btnEx3 = ThemeHelper.CreateExampleChip("Örnek 3: x²y + y³ (1, 2)");
|
this.btnEx3 = ThemeHelper.CreateExampleChip("x²y + y³ (1, 2)");
|
||||||
|
this.btnEx4 = ThemeHelper.CreateExampleChip("x² + y² + z² (0, 0, 0)");
|
||||||
|
this.btnEx5 = ThemeHelper.CreateExampleChip("ln(1 + x*y) (0, 0)");
|
||||||
|
|
||||||
|
// Main Input Card
|
||||||
|
this.pnlInputCard = new Panel();
|
||||||
this.lblEquation = new Label();
|
this.lblEquation = new Label();
|
||||||
this.txtEquation = new TextBox();
|
this.txtEquation = new TextBox();
|
||||||
this.lblOrder = new Label();
|
this.lblOrder = new Label();
|
||||||
this.numOrder = new NumericUpDown();
|
this.numOrder = new NumericUpDown();
|
||||||
this.grpVariables = new GroupBox();
|
this.btnCalculate = ThemeHelper.CreateActionButton("📐 Seriyi Hesapla", 180, 36, true);
|
||||||
this.pnlVariables = new FlowLayoutPanel();
|
|
||||||
this.btnAddVar = ThemeHelper.CreateActionButton("+ Değişken Ekle", 150, 30, false);
|
// Variable Chips Area
|
||||||
this.btnCalculate = ThemeHelper.CreateActionButton("📐 Seriyi Hesapla", 190, 38, true);
|
this.pnlVarCard = new Panel();
|
||||||
this.lblResult = new Label();
|
this.lblVarTitle = new Label();
|
||||||
|
this.pnlVariableChips = new FlowLayoutPanel();
|
||||||
|
this.btnAddVar = ThemeHelper.CreateActionButton("+ Değişken Ekle", 130, 28, false);
|
||||||
|
this.btnResetZero = new Button();
|
||||||
|
|
||||||
|
// TabControl for Results
|
||||||
|
this.tabResults = new TabControl();
|
||||||
|
this.tabLayers = new TabPage();
|
||||||
|
this.tabTable = new TabPage();
|
||||||
|
this.tabReport = new TabPage();
|
||||||
|
|
||||||
|
// Tab 1: Layered Cards (Linear/Tangent, Quadratic/Hessian, Full Expansion)
|
||||||
|
this.pnlLayersScroll = new Panel();
|
||||||
|
this.pnlTangentCard = new Panel();
|
||||||
|
this.lblTangentTitle = new Label();
|
||||||
|
this.lblTangentValue = new Label();
|
||||||
|
this.lblGradientValue = new Label();
|
||||||
|
this.btnCopyTangent = ThemeHelper.CreateCopyButton("📋 Teğet Düzlemini Kopyala");
|
||||||
|
|
||||||
|
this.pnlHessianCard = new Panel();
|
||||||
|
this.lblHessianTitle = new Label();
|
||||||
|
this.lblHessianValue = new Label();
|
||||||
|
this.lblHessianDet = new Label();
|
||||||
|
|
||||||
|
this.pnlFullPolyCard = new Panel();
|
||||||
|
this.lblFullPolyTitle = new Label();
|
||||||
|
this.lblFullPolyValue = new Label();
|
||||||
|
this.btnCopyFullPoly = ThemeHelper.CreateCopyButton("📋 Polinomu Kopyala");
|
||||||
|
this.btnCopyLatex = ThemeHelper.CreateCopyButton("LaTeX");
|
||||||
|
|
||||||
|
// Tab 2: Derivatives Grid
|
||||||
|
this.dgvMultiTerms = new DataGridView();
|
||||||
|
|
||||||
|
// Tab 3: Detailed Text Console
|
||||||
this.txtResult = new TextBox();
|
this.txtResult = new TextBox();
|
||||||
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numOrder)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numOrder)).BeginInit();
|
||||||
this.grpVariables.SuspendLayout();
|
|
||||||
this.pnlContent.SuspendLayout();
|
this.pnlContent.SuspendLayout();
|
||||||
|
this.pnlInputCard.SuspendLayout();
|
||||||
|
this.pnlVarCard.SuspendLayout();
|
||||||
|
this.tabResults.SuspendLayout();
|
||||||
|
this.tabLayers.SuspendLayout();
|
||||||
|
this.pnlLayersScroll.SuspendLayout();
|
||||||
|
this.pnlTangentCard.SuspendLayout();
|
||||||
|
this.pnlHessianCard.SuspendLayout();
|
||||||
|
this.pnlFullPolyCard.SuspendLayout();
|
||||||
|
this.tabTable.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgvMultiTerms)).BeginInit();
|
||||||
|
this.tabReport.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
|
||||||
this.pnlContent.Dock = DockStyle.Fill;
|
this.pnlContent.Dock = DockStyle.Fill;
|
||||||
this.pnlContent.BackColor = ThemeHelper.DarkBackground;
|
this.pnlContent.BackColor = ThemeHelper.DarkBackground;
|
||||||
this.pnlContent.Padding = new Padding(24, 16, 24, 24);
|
this.pnlContent.Padding = new Padding(20, 10, 20, 16);
|
||||||
|
this.pnlContent.AutoScroll = true;
|
||||||
|
|
||||||
this.lblPresets.Text = "Hızlı Örnekler:";
|
// Presets
|
||||||
|
this.lblPresets.Text = "⚡ Hızlı Örnekler:";
|
||||||
this.lblPresets.AutoSize = true;
|
this.lblPresets.AutoSize = true;
|
||||||
this.lblPresets.ForeColor = ThemeHelper.MutedText;
|
this.lblPresets.ForeColor = ThemeHelper.MutedText;
|
||||||
this.lblPresets.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
this.lblPresets.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
this.lblPresets.Margin = new Padding(0, 6, 10, 0);
|
this.lblPresets.Margin = new Padding(0, 5, 8, 0);
|
||||||
|
|
||||||
this.pnlPresets.Location = new Point(24, 14);
|
this.pnlPresets.Location = new Point(20, 8);
|
||||||
this.pnlPresets.Size = new Size(800, 36);
|
this.pnlPresets.Size = new Size(880, 32);
|
||||||
this.pnlPresets.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
this.pnlPresets.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
this.pnlPresets.Controls.Add(this.lblPresets);
|
this.pnlPresets.Controls.Add(this.lblPresets);
|
||||||
this.pnlPresets.Controls.Add(this.btnEx1);
|
this.pnlPresets.Controls.Add(this.btnEx1);
|
||||||
this.pnlPresets.Controls.Add(this.btnEx2);
|
this.pnlPresets.Controls.Add(this.btnEx2);
|
||||||
this.pnlPresets.Controls.Add(this.btnEx3);
|
this.pnlPresets.Controls.Add(this.btnEx3);
|
||||||
|
this.pnlPresets.Controls.Add(this.btnEx4);
|
||||||
|
this.pnlPresets.Controls.Add(this.btnEx5);
|
||||||
|
|
||||||
int y = 60;
|
// Input Card
|
||||||
|
this.pnlInputCard.Location = new Point(20, 44);
|
||||||
|
this.pnlInputCard.Size = new Size(880, 48);
|
||||||
|
this.pnlInputCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
this.pnlInputCard.BackColor = ThemeHelper.CardBackground;
|
||||||
|
this.pnlInputCard.Padding = new Padding(12, 8, 12, 8);
|
||||||
|
|
||||||
this.lblEquation.AutoSize = true;
|
this.lblEquation.AutoSize = true;
|
||||||
this.lblEquation.ForeColor = ThemeHelper.LightText;
|
this.lblEquation.ForeColor = ThemeHelper.LightText;
|
||||||
this.lblEquation.Font = new Font("Segoe UI", 10F);
|
this.lblEquation.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
this.lblEquation.Location = new Point(24, y + 3);
|
this.lblEquation.Location = new Point(12, 16);
|
||||||
this.lblEquation.Text = "Fonksiyon f(x, y, ...):";
|
this.lblEquation.Text = "Fonksiyon f(x, y, ...):";
|
||||||
|
|
||||||
this.txtEquation.BackColor = ThemeHelper.CardBackground;
|
this.txtEquation.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.txtEquation.BorderStyle = BorderStyle.FixedSingle;
|
this.txtEquation.BorderStyle = BorderStyle.FixedSingle;
|
||||||
this.txtEquation.ForeColor = Color.White;
|
this.txtEquation.ForeColor = Color.White;
|
||||||
this.txtEquation.Font = new Font("Consolas", 11F);
|
this.txtEquation.Font = new Font("Consolas", 10.5F);
|
||||||
this.txtEquation.Location = new Point(165, y);
|
this.txtEquation.Location = new Point(140, 12);
|
||||||
this.txtEquation.Size = new Size(290, 27);
|
this.txtEquation.Size = new Size(340, 24);
|
||||||
this.txtEquation.Text = "sin(x)*cos(y)";
|
this.txtEquation.Text = "sin(x)*cos(y)";
|
||||||
|
|
||||||
this.lblOrder.AutoSize = true;
|
this.lblOrder.AutoSize = true;
|
||||||
this.lblOrder.ForeColor = ThemeHelper.LightText;
|
this.lblOrder.ForeColor = ThemeHelper.LightText;
|
||||||
this.lblOrder.Font = new Font("Segoe UI", 10F);
|
this.lblOrder.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
this.lblOrder.Location = new Point(475, y + 3);
|
this.lblOrder.Location = new Point(500, 16);
|
||||||
this.lblOrder.Text = "Derece (n):";
|
this.lblOrder.Text = "Derece (n):";
|
||||||
|
|
||||||
this.numOrder.BackColor = ThemeHelper.CardBackground;
|
this.numOrder.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.numOrder.ForeColor = Color.White;
|
this.numOrder.ForeColor = Color.White;
|
||||||
this.numOrder.BorderStyle = BorderStyle.FixedSingle;
|
this.numOrder.BorderStyle = BorderStyle.FixedSingle;
|
||||||
this.numOrder.Font = new Font("Consolas", 11F);
|
this.numOrder.Font = new Font("Consolas", 10F);
|
||||||
this.numOrder.Location = new Point(560, y);
|
this.numOrder.Location = new Point(575, 13);
|
||||||
this.numOrder.Maximum = 5;
|
this.numOrder.Maximum = 5;
|
||||||
this.numOrder.Minimum = 1;
|
this.numOrder.Minimum = 1;
|
||||||
this.numOrder.Size = new Size(65, 27);
|
this.numOrder.Size = new Size(50, 23);
|
||||||
this.numOrder.Value = 3;
|
this.numOrder.Value = 3;
|
||||||
|
|
||||||
this.btnCalculate.Location = new Point(645, y - 5);
|
this.btnCalculate.Location = new Point(650, 7);
|
||||||
y += 46;
|
|
||||||
|
|
||||||
this.grpVariables.Controls.Add(this.pnlVariables);
|
this.pnlInputCard.Controls.Add(this.lblEquation);
|
||||||
this.grpVariables.Controls.Add(this.btnAddVar);
|
this.pnlInputCard.Controls.Add(this.txtEquation);
|
||||||
this.grpVariables.ForeColor = ThemeHelper.LightText;
|
this.pnlInputCard.Controls.Add(this.lblOrder);
|
||||||
this.grpVariables.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
this.pnlInputCard.Controls.Add(this.numOrder);
|
||||||
this.grpVariables.Location = new Point(24, y);
|
this.pnlInputCard.Controls.Add(this.btnCalculate);
|
||||||
this.grpVariables.Size = new Size(820, 195);
|
|
||||||
this.grpVariables.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
||||||
this.grpVariables.TabStop = false;
|
|
||||||
this.grpVariables.Text = "Değişkenler ve Açılım Merkez Noktaları";
|
|
||||||
|
|
||||||
this.pnlVariables.AutoScroll = true;
|
// Variable Chips Card
|
||||||
this.pnlVariables.FlowDirection = FlowDirection.TopDown;
|
this.pnlVarCard.Location = new Point(20, 98);
|
||||||
this.pnlVariables.WrapContents = false;
|
this.pnlVarCard.Size = new Size(880, 76);
|
||||||
this.pnlVariables.Location = new Point(12, 26);
|
this.pnlVarCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
this.pnlVariables.Size = new Size(796, 122);
|
this.pnlVarCard.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
this.pnlVariables.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
this.pnlVarCard.Padding = new Padding(10, 6, 10, 6);
|
||||||
this.pnlVariables.BackColor = Color.FromArgb(11, 17, 32);
|
|
||||||
this.pnlVariables.Padding = new Padding(6);
|
|
||||||
|
|
||||||
this.btnAddVar.Location = new Point(12, 155);
|
this.lblVarTitle.Text = "Değişkenler ve Merkez Noktaları (x₀):";
|
||||||
y += 208;
|
this.lblVarTitle.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
|
this.lblVarTitle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
this.lblVarTitle.Location = new Point(10, 6);
|
||||||
|
this.lblVarTitle.AutoSize = true;
|
||||||
|
|
||||||
this.lblResult.AutoSize = true;
|
this.btnAddVar.Location = new Point(650, 6);
|
||||||
this.lblResult.ForeColor = ThemeHelper.LightText;
|
this.btnAddVar.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
this.lblResult.Font = new Font("Segoe UI Semibold", 10F, FontStyle.Bold);
|
|
||||||
this.lblResult.Location = new Point(24, y);
|
|
||||||
this.lblResult.Text = "📊 Çok Değişkenli Taylor Polinomu:";
|
|
||||||
|
|
||||||
this.btnCopyMultiTaylor = ThemeHelper.CreateCopyButton("📋 Kopyala");
|
this.btnResetZero.Text = "Tümü = 0";
|
||||||
this.btnCopyMultiTaylor.Location = new Point(750, y - 4);
|
this.btnResetZero.Location = new Point(788, 6);
|
||||||
this.btnCopyMultiTaylor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
this.btnResetZero.Size = new Size(76, 28);
|
||||||
|
this.btnResetZero.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
this.btnResetZero.BackColor = Color.FromArgb(33, 44, 70);
|
||||||
|
this.btnResetZero.ForeColor = Color.FromArgb(186, 230, 253);
|
||||||
|
this.btnResetZero.FlatStyle = FlatStyle.Flat;
|
||||||
|
this.btnResetZero.FlatAppearance.BorderSize = 0;
|
||||||
|
this.btnResetZero.Font = new Font("Segoe UI", 8F);
|
||||||
|
this.btnResetZero.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
y += 26;
|
this.pnlVariableChips.Location = new Point(10, 28);
|
||||||
|
this.pnlVariableChips.Size = new Size(856, 42);
|
||||||
|
this.pnlVariableChips.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
this.pnlVariableChips.FlowDirection = FlowDirection.LeftToRight;
|
||||||
|
this.pnlVariableChips.WrapContents = true;
|
||||||
|
this.pnlVariableChips.AutoScroll = true;
|
||||||
|
|
||||||
this.txtResult.BackColor = ThemeHelper.CardBackground;
|
this.pnlVarCard.Controls.Add(this.lblVarTitle);
|
||||||
this.txtResult.BorderStyle = BorderStyle.FixedSingle;
|
this.pnlVarCard.Controls.Add(this.btnAddVar);
|
||||||
this.txtResult.Font = new Font("Consolas", 10.5F);
|
this.pnlVarCard.Controls.Add(this.btnResetZero);
|
||||||
|
this.pnlVarCard.Controls.Add(this.pnlVariableChips);
|
||||||
|
|
||||||
|
// TabControl for Results
|
||||||
|
this.tabResults.Location = new Point(20, 182);
|
||||||
|
this.tabResults.Size = new Size(880, 460);
|
||||||
|
this.tabResults.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
this.tabResults.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
|
|
||||||
|
// TAB 1: Layered Cards
|
||||||
|
this.tabLayers.Text = "Katmanlı Yaklaşımlar (Doğrusal / Hessian / Polinom)";
|
||||||
|
this.tabLayers.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
|
this.tabLayers.Padding = new Padding(8);
|
||||||
|
|
||||||
|
this.pnlLayersScroll.Dock = DockStyle.Fill;
|
||||||
|
this.pnlLayersScroll.AutoScroll = true;
|
||||||
|
|
||||||
|
// Block 1: Tangent Plane (n=1)
|
||||||
|
this.pnlTangentCard.Location = new Point(4, 4);
|
||||||
|
this.pnlTangentCard.Size = new Size(840, 85);
|
||||||
|
this.pnlTangentCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
this.pnlTangentCard.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.pnlTangentCard.Padding = new Padding(12, 8, 12, 8);
|
||||||
|
|
||||||
|
this.lblTangentTitle.Text = "1. DERECE DOĞRUSAL YAKLAŞIM / TEĞET DÜZLEM (L(x, y))";
|
||||||
|
this.lblTangentTitle.Location = new Point(12, 8);
|
||||||
|
this.lblTangentTitle.AutoSize = true;
|
||||||
|
this.lblTangentTitle.Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold);
|
||||||
|
this.lblTangentTitle.ForeColor = Color.FromArgb(56, 189, 248);
|
||||||
|
|
||||||
|
this.lblTangentValue.Text = "L(x, y) = —";
|
||||||
|
this.lblTangentValue.Location = new Point(12, 28);
|
||||||
|
this.lblTangentValue.Size = new Size(620, 24);
|
||||||
|
this.lblTangentValue.Font = new Font("Consolas", 11F, FontStyle.Bold);
|
||||||
|
this.lblTangentValue.ForeColor = Color.White;
|
||||||
|
|
||||||
|
this.lblGradientValue.Text = "Gradyan ∇f(a) = [ — ]";
|
||||||
|
this.lblGradientValue.Location = new Point(12, 54);
|
||||||
|
this.lblGradientValue.Size = new Size(620, 20);
|
||||||
|
this.lblGradientValue.Font = new Font("Consolas", 9F);
|
||||||
|
this.lblGradientValue.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
|
||||||
|
this.btnCopyTangent.Location = new Point(650, 18);
|
||||||
|
this.btnCopyTangent.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
|
||||||
|
this.pnlTangentCard.Controls.Add(this.lblTangentTitle);
|
||||||
|
this.pnlTangentCard.Controls.Add(this.lblTangentValue);
|
||||||
|
this.pnlTangentCard.Controls.Add(this.lblGradientValue);
|
||||||
|
this.pnlTangentCard.Controls.Add(this.btnCopyTangent);
|
||||||
|
|
||||||
|
// Block 2: Quadratic / Hessian (n=2)
|
||||||
|
this.pnlHessianCard.Location = new Point(4, 96);
|
||||||
|
this.pnlHessianCard.Size = new Size(840, 115);
|
||||||
|
this.pnlHessianCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
this.pnlHessianCard.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.pnlHessianCard.Padding = new Padding(12, 8, 12, 8);
|
||||||
|
|
||||||
|
this.lblHessianTitle.Text = "2. DERECE KUADRATİK YAKLAŞIM & HESSIAN MATRİSİ (Q(x, y))";
|
||||||
|
this.lblHessianTitle.Location = new Point(12, 8);
|
||||||
|
this.lblHessianTitle.AutoSize = true;
|
||||||
|
this.lblHessianTitle.Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold);
|
||||||
|
this.lblHessianTitle.ForeColor = Color.FromArgb(168, 85, 247);
|
||||||
|
|
||||||
|
this.lblHessianValue.Text = "Q(x, y) = —";
|
||||||
|
this.lblHessianValue.Location = new Point(12, 28);
|
||||||
|
this.lblHessianValue.Size = new Size(815, 24);
|
||||||
|
this.lblHessianValue.Font = new Font("Consolas", 10.5F, FontStyle.Bold);
|
||||||
|
this.lblHessianValue.ForeColor = Color.White;
|
||||||
|
|
||||||
|
this.lblHessianDet.Text = "Hessian H(a) ve Ekstremum Durumu: —";
|
||||||
|
this.lblHessianDet.Location = new Point(12, 56);
|
||||||
|
this.lblHessianDet.Size = new Size(815, 48);
|
||||||
|
this.lblHessianDet.Font = new Font("Consolas", 9F);
|
||||||
|
this.lblHessianDet.ForeColor = Color.FromArgb(226, 232, 240);
|
||||||
|
|
||||||
|
this.pnlHessianCard.Controls.Add(this.lblHessianTitle);
|
||||||
|
this.pnlHessianCard.Controls.Add(this.lblHessianValue);
|
||||||
|
this.pnlHessianCard.Controls.Add(this.lblHessianDet);
|
||||||
|
|
||||||
|
// Block 3: Full Polynomial
|
||||||
|
this.pnlFullPolyCard.Location = new Point(4, 218);
|
||||||
|
this.pnlFullPolyCard.Size = new Size(840, 110);
|
||||||
|
this.pnlFullPolyCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
|
this.pnlFullPolyCard.BackColor = Color.FromArgb(20, 30, 48);
|
||||||
|
this.pnlFullPolyCard.Padding = new Padding(12, 8, 12, 8);
|
||||||
|
|
||||||
|
this.lblFullPolyTitle.Text = "TAM ÇOK DEĞİŞKENLİ POLİNOM AÇILIMI (T_n)";
|
||||||
|
this.lblFullPolyTitle.Location = new Point(12, 8);
|
||||||
|
this.lblFullPolyTitle.AutoSize = true;
|
||||||
|
this.lblFullPolyTitle.Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold);
|
||||||
|
this.lblFullPolyTitle.ForeColor = Color.FromArgb(52, 211, 153);
|
||||||
|
|
||||||
|
this.lblFullPolyValue.Text = "T_n = —";
|
||||||
|
this.lblFullPolyValue.Location = new Point(12, 30);
|
||||||
|
this.lblFullPolyValue.Size = new Size(650, 70);
|
||||||
|
this.lblFullPolyValue.Font = new Font("Consolas", 10.5F, FontStyle.Bold);
|
||||||
|
this.lblFullPolyValue.ForeColor = Color.FromArgb(52, 211, 153);
|
||||||
|
|
||||||
|
this.btnCopyFullPoly.Location = new Point(680, 14);
|
||||||
|
this.btnCopyFullPoly.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
|
||||||
|
this.btnCopyLatex.Location = new Point(780, 14);
|
||||||
|
this.btnCopyLatex.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
|
||||||
|
this.pnlFullPolyCard.Controls.Add(this.lblFullPolyTitle);
|
||||||
|
this.pnlFullPolyCard.Controls.Add(this.lblFullPolyValue);
|
||||||
|
this.pnlFullPolyCard.Controls.Add(this.btnCopyFullPoly);
|
||||||
|
this.pnlFullPolyCard.Controls.Add(this.btnCopyLatex);
|
||||||
|
|
||||||
|
this.pnlLayersScroll.Controls.Add(this.pnlFullPolyCard);
|
||||||
|
this.pnlLayersScroll.Controls.Add(this.pnlHessianCard);
|
||||||
|
this.pnlLayersScroll.Controls.Add(this.pnlTangentCard);
|
||||||
|
this.tabLayers.Controls.Add(this.pnlLayersScroll);
|
||||||
|
|
||||||
|
// TAB 2: Table
|
||||||
|
this.tabTable.Text = "Kısmi & Çapraz Türevler Tablosu";
|
||||||
|
this.tabTable.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabTable.Padding = new Padding(6);
|
||||||
|
SetupGrid(this.dgvMultiTerms);
|
||||||
|
this.tabTable.Controls.Add(this.dgvMultiTerms);
|
||||||
|
|
||||||
|
// TAB 3: Report
|
||||||
|
this.tabReport.Text = "Analitik Rapor";
|
||||||
|
this.tabReport.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabReport.Padding = new Padding(6);
|
||||||
|
|
||||||
|
this.txtResult.Dock = DockStyle.Fill;
|
||||||
|
this.txtResult.BackColor = Color.FromArgb(11, 15, 28);
|
||||||
|
this.txtResult.BorderStyle = BorderStyle.None;
|
||||||
this.txtResult.ForeColor = Color.FromArgb(186, 230, 253);
|
this.txtResult.ForeColor = Color.FromArgb(186, 230, 253);
|
||||||
this.txtResult.Location = new Point(24, y);
|
|
||||||
this.txtResult.Multiline = true;
|
this.txtResult.Multiline = true;
|
||||||
this.txtResult.ReadOnly = true;
|
this.txtResult.ReadOnly = true;
|
||||||
this.txtResult.ScrollBars = ScrollBars.Vertical;
|
this.txtResult.ScrollBars = ScrollBars.Vertical;
|
||||||
this.txtResult.Size = new Size(820, 215);
|
this.txtResult.Font = new Font("Consolas", 9.5F);
|
||||||
this.txtResult.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
this.tabReport.Controls.Add(this.txtResult);
|
||||||
|
|
||||||
this.pnlContent.Controls.Add(this.btnCopyMultiTaylor);
|
this.tabResults.TabPages.Add(this.tabLayers);
|
||||||
|
this.tabResults.TabPages.Add(this.tabTable);
|
||||||
|
this.tabResults.TabPages.Add(this.tabReport);
|
||||||
|
|
||||||
|
this.pnlContent.Controls.Add(this.tabResults);
|
||||||
|
this.pnlContent.Controls.Add(this.pnlVarCard);
|
||||||
|
this.pnlContent.Controls.Add(this.pnlInputCard);
|
||||||
this.pnlContent.Controls.Add(this.pnlPresets);
|
this.pnlContent.Controls.Add(this.pnlPresets);
|
||||||
this.pnlContent.Controls.Add(this.txtResult);
|
|
||||||
this.pnlContent.Controls.Add(this.lblResult);
|
|
||||||
this.pnlContent.Controls.Add(this.btnCalculate);
|
|
||||||
this.pnlContent.Controls.Add(this.grpVariables);
|
|
||||||
this.pnlContent.Controls.Add(this.numOrder);
|
|
||||||
this.pnlContent.Controls.Add(this.lblOrder);
|
|
||||||
this.pnlContent.Controls.Add(this.txtEquation);
|
|
||||||
this.pnlContent.Controls.Add(this.lblEquation);
|
|
||||||
|
|
||||||
this.AutoScaleDimensions = new SizeF(7F, 15F);
|
this.AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = AutoScaleMode.Font;
|
this.AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
|
@ -161,15 +349,55 @@ namespace MathApp.Controls
|
||||||
this.Controls.Add(this.pnlContent);
|
this.Controls.Add(this.pnlContent);
|
||||||
this.Controls.Add(this.pnlHeader);
|
this.Controls.Add(this.pnlHeader);
|
||||||
this.Name = "MultivariableTaylorControl";
|
this.Name = "MultivariableTaylorControl";
|
||||||
this.Size = new Size(880, 660);
|
this.Size = new Size(920, 720);
|
||||||
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numOrder)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numOrder)).EndInit();
|
||||||
this.grpVariables.ResumeLayout(false);
|
|
||||||
this.pnlContent.ResumeLayout(false);
|
this.pnlContent.ResumeLayout(false);
|
||||||
this.pnlContent.PerformLayout();
|
this.pnlInputCard.ResumeLayout(false);
|
||||||
|
this.pnlInputCard.PerformLayout();
|
||||||
|
this.pnlVarCard.ResumeLayout(false);
|
||||||
|
this.pnlVarCard.PerformLayout();
|
||||||
|
this.tabResults.ResumeLayout(false);
|
||||||
|
this.tabLayers.ResumeLayout(false);
|
||||||
|
this.pnlLayersScroll.ResumeLayout(false);
|
||||||
|
this.pnlTangentCard.ResumeLayout(false);
|
||||||
|
this.pnlTangentCard.PerformLayout();
|
||||||
|
this.pnlHessianCard.ResumeLayout(false);
|
||||||
|
this.pnlHessianCard.PerformLayout();
|
||||||
|
this.pnlFullPolyCard.ResumeLayout(false);
|
||||||
|
this.pnlFullPolyCard.PerformLayout();
|
||||||
|
this.tabTable.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgvMultiTerms)).EndInit();
|
||||||
|
this.tabReport.ResumeLayout(false);
|
||||||
|
this.tabReport.PerformLayout();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetupGrid(DataGridView dgv)
|
||||||
|
{
|
||||||
|
dgv.Dock = DockStyle.Fill;
|
||||||
|
dgv.BackgroundColor = Color.FromArgb(15, 23, 42);
|
||||||
|
dgv.BorderStyle = BorderStyle.None;
|
||||||
|
dgv.EnableHeadersVisualStyles = false;
|
||||||
|
dgv.AllowUserToAddRows = false;
|
||||||
|
dgv.AllowUserToDeleteRows = false;
|
||||||
|
dgv.AllowUserToResizeRows = false;
|
||||||
|
dgv.RowHeadersVisible = false;
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
|
dgv.ColumnHeadersHeight = 26;
|
||||||
|
dgv.DefaultCellStyle.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
|
dgv.DefaultCellStyle.ForeColor = Color.White;
|
||||||
|
dgv.DefaultCellStyle.Font = new Font("Consolas", 9.5F);
|
||||||
|
dgv.DefaultCellStyle.SelectionBackColor = Color.FromArgb(37, 99, 235);
|
||||||
|
dgv.DefaultCellStyle.SelectionForeColor = Color.White;
|
||||||
|
dgv.GridColor = Color.FromArgb(40, 50, 75);
|
||||||
|
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dgv.ReadOnly = true;
|
||||||
|
}
|
||||||
|
|
||||||
private Panel pnlHeader;
|
private Panel pnlHeader;
|
||||||
private Panel pnlContent;
|
private Panel pnlContent;
|
||||||
private FlowLayoutPanel pnlPresets;
|
private FlowLayoutPanel pnlPresets;
|
||||||
|
|
@ -177,16 +405,45 @@ namespace MathApp.Controls
|
||||||
private Button btnEx1;
|
private Button btnEx1;
|
||||||
private Button btnEx2;
|
private Button btnEx2;
|
||||||
private Button btnEx3;
|
private Button btnEx3;
|
||||||
|
private Button btnEx4;
|
||||||
|
private Button btnEx5;
|
||||||
|
|
||||||
|
private Panel pnlInputCard;
|
||||||
private Label lblEquation;
|
private Label lblEquation;
|
||||||
private TextBox txtEquation;
|
private TextBox txtEquation;
|
||||||
private Label lblOrder;
|
private Label lblOrder;
|
||||||
private NumericUpDown numOrder;
|
private NumericUpDown numOrder;
|
||||||
private GroupBox grpVariables;
|
|
||||||
private FlowLayoutPanel pnlVariables;
|
|
||||||
private Button btnAddVar;
|
|
||||||
private Button btnCalculate;
|
private Button btnCalculate;
|
||||||
private Label lblResult;
|
|
||||||
private Button btnCopyMultiTaylor;
|
private Panel pnlVarCard;
|
||||||
|
private Label lblVarTitle;
|
||||||
|
private FlowLayoutPanel pnlVariableChips;
|
||||||
|
private Button btnAddVar;
|
||||||
|
private Button btnResetZero;
|
||||||
|
|
||||||
|
private TabControl tabResults;
|
||||||
|
private TabPage tabLayers;
|
||||||
|
private Panel pnlLayersScroll;
|
||||||
|
private Panel pnlTangentCard;
|
||||||
|
private Label lblTangentTitle;
|
||||||
|
private Label lblTangentValue;
|
||||||
|
private Label lblGradientValue;
|
||||||
|
private Button btnCopyTangent;
|
||||||
|
|
||||||
|
private Panel pnlHessianCard;
|
||||||
|
private Label lblHessianTitle;
|
||||||
|
private Label lblHessianValue;
|
||||||
|
private Label lblHessianDet;
|
||||||
|
|
||||||
|
private Panel pnlFullPolyCard;
|
||||||
|
private Label lblFullPolyTitle;
|
||||||
|
private Label lblFullPolyValue;
|
||||||
|
private Button btnCopyFullPoly;
|
||||||
|
private Button btnCopyLatex;
|
||||||
|
|
||||||
|
private TabPage tabTable;
|
||||||
|
private DataGridView dgvMultiTerms;
|
||||||
|
private TabPage tabReport;
|
||||||
private TextBox txtResult;
|
private TextBox txtResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,23 +11,47 @@ namespace MathApp.Controls
|
||||||
{
|
{
|
||||||
public partial class MultivariableTaylorControl : UserControl
|
public partial class MultivariableTaylorControl : UserControl
|
||||||
{
|
{
|
||||||
private List<VariableInputRow> variableRows = new List<VariableInputRow>();
|
private List<VariableChip> variableChips = new List<VariableChip>();
|
||||||
|
private string _lastTangentPlane = "";
|
||||||
|
private string _lastFullPoly = "";
|
||||||
|
|
||||||
public MultivariableTaylorControl()
|
public MultivariableTaylorControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InitializeGridColumns();
|
||||||
|
|
||||||
btnAddVar.Click += BtnAddVar_Click;
|
btnAddVar.Click += BtnAddVar_Click;
|
||||||
|
btnResetZero.Click += BtnResetZero_Click;
|
||||||
btnCalculate.Click += BtnCalculate_Click;
|
btnCalculate.Click += BtnCalculate_Click;
|
||||||
|
|
||||||
btnEx1.Click += (s, e) => LoadPreset("sin(x)*cos(y)", 3, new[] { ("x", "0"), ("y", "0") });
|
btnEx1.Click += (s, e) => LoadPreset("sin(x)*cos(y)", 3, new[] { ("x", "0"), ("y", "0") });
|
||||||
btnEx2.Click += (s, e) => LoadPreset("exp(x + y)", 2, new[] { ("x", "0"), ("y", "0") });
|
btnEx2.Click += (s, e) => LoadPreset("exp(x + y)", 2, new[] { ("x", "0"), ("y", "0") });
|
||||||
btnEx3.Click += (s, e) => LoadPreset("x^2*y + y^3", 3, new[] { ("x", "1"), ("y", "2") });
|
btnEx3.Click += (s, e) => LoadPreset("x^2*y + y^3", 3, new[] { ("x", "1"), ("y", "2") });
|
||||||
|
btnEx4.Click += (s, e) => LoadPreset("x^2 + y^2 + z^2", 2, new[] { ("x", "0"), ("y", "0"), ("z", "0") });
|
||||||
|
btnEx5.Click += (s, e) => LoadPreset("ln(1 + x*y)", 3, new[] { ("x", "0"), ("y", "0") });
|
||||||
|
|
||||||
btnCopyMultiTaylor.Click += (s, e) => {
|
btnCopyTangent.Click += (s, e) => {
|
||||||
if (!string.IsNullOrEmpty(txtResult.Text))
|
if (!string.IsNullOrEmpty(_lastTangentPlane))
|
||||||
{
|
{
|
||||||
Clipboard.SetText(txtResult.Text);
|
Clipboard.SetText(_lastTangentPlane);
|
||||||
MessageBox.Show("Çok değişkenli Taylor serisi panoya kopyalandı!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Teğet düzlemi formülü panoya kopyalandı!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
btnCopyFullPoly.Click += (s, e) => {
|
||||||
|
if (!string.IsNullOrEmpty(_lastFullPoly))
|
||||||
|
{
|
||||||
|
Clipboard.SetText(_lastFullPoly);
|
||||||
|
MessageBox.Show("Çok değişkenli Taylor polinomu panoya kopyalandı!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
btnCopyLatex.Click += (s, e) => {
|
||||||
|
if (!string.IsNullOrEmpty(_lastFullPoly))
|
||||||
|
{
|
||||||
|
string latex = "T_{" + numOrder.Value + "} = " + _lastFullPoly.Replace("*", " \\cdot ");
|
||||||
|
Clipboard.SetText(latex);
|
||||||
|
MessageBox.Show("Polinom LaTeX formatında panoya kopyalandı:\n\n" + latex, "LaTeX Kopyalandı", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -39,19 +63,40 @@ namespace MathApp.Controls
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AddVariableRow("x", "0");
|
AddVariableChip("x", "0");
|
||||||
AddVariableRow("y", "0");
|
AddVariableChip("y", "0");
|
||||||
|
|
||||||
|
LoadPreset("sin(x)*cos(y)", 3, new[] { ("x", "0"), ("y", "0") });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeGridColumns()
|
||||||
|
{
|
||||||
|
dgvMultiTerms.Columns.Clear();
|
||||||
|
dgvMultiTerms.Columns.Add("deg", "|α|");
|
||||||
|
dgvMultiTerms.Columns.Add("op", "Kısmi Diferansiyel Operatörü");
|
||||||
|
dgvMultiTerms.Columns.Add("val", "Noktadaki Değer");
|
||||||
|
dgvMultiTerms.Columns.Add("denom", "Payda α!");
|
||||||
|
dgvMultiTerms.Columns.Add("fracC", "Kesirli Katsayı");
|
||||||
|
dgvMultiTerms.Columns.Add("decC", "Ondalık Katsayı");
|
||||||
|
dgvMultiTerms.Columns.Add("term", "Polinom Terimi");
|
||||||
|
|
||||||
|
dgvMultiTerms.Columns["deg"].Width = 45;
|
||||||
|
dgvMultiTerms.Columns["op"].Width = 160;
|
||||||
|
dgvMultiTerms.Columns["val"].Width = 110;
|
||||||
|
dgvMultiTerms.Columns["denom"].Width = 70;
|
||||||
|
dgvMultiTerms.Columns["fracC"].Width = 110;
|
||||||
|
dgvMultiTerms.Columns["decC"].Width = 110;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadPreset(string eq, int order, (string v, string val)[] vars)
|
private void LoadPreset(string eq, int order, (string v, string val)[] vars)
|
||||||
{
|
{
|
||||||
txtEquation.Text = eq;
|
txtEquation.Text = eq;
|
||||||
numOrder.Value = order;
|
numOrder.Value = order;
|
||||||
pnlVariables.Controls.Clear();
|
pnlVariableChips.Controls.Clear();
|
||||||
variableRows.Clear();
|
variableChips.Clear();
|
||||||
foreach (var item in vars)
|
foreach (var item in vars)
|
||||||
{
|
{
|
||||||
AddVariableRow(item.v, item.val);
|
AddVariableChip(item.v, item.val);
|
||||||
}
|
}
|
||||||
BtnCalculate_Click(this, EventArgs.Empty);
|
BtnCalculate_Click(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
@ -59,21 +104,29 @@ namespace MathApp.Controls
|
||||||
private void BtnAddVar_Click(object sender, EventArgs e)
|
private void BtnAddVar_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string[] names = { "x", "y", "z", "w", "u", "v" };
|
string[] names = { "x", "y", "z", "w", "u", "v" };
|
||||||
string suggested = variableRows.Count < names.Length ? names[variableRows.Count] : "v" + (variableRows.Count + 1);
|
string suggested = variableChips.Count < names.Length ? names[variableChips.Count] : "v" + (variableChips.Count + 1);
|
||||||
AddVariableRow(suggested, "0");
|
AddVariableChip(suggested, "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddVariableRow(string varName, string val)
|
private void BtnResetZero_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
VariableInputRow row = new VariableInputRow(varName, val);
|
foreach (var chip in variableChips)
|
||||||
row.OnRemove += (s, e) =>
|
|
||||||
{
|
{
|
||||||
pnlVariables.Controls.Remove(row.Panel);
|
chip.Value = "0";
|
||||||
variableRows.Remove(row);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddVariableChip(string varName, string val)
|
||||||
|
{
|
||||||
|
VariableChip chip = new VariableChip(varName, val);
|
||||||
|
chip.OnRemove += (s, e) =>
|
||||||
|
{
|
||||||
|
pnlVariableChips.Controls.Remove(chip.Panel);
|
||||||
|
variableChips.Remove(chip);
|
||||||
};
|
};
|
||||||
|
|
||||||
pnlVariables.Controls.Add(row.Panel);
|
pnlVariableChips.Controls.Add(chip.Panel);
|
||||||
variableRows.Add(row);
|
variableChips.Add(chip);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void BtnCalculate_Click(object sender, EventArgs e)
|
private async void BtnCalculate_Click(object sender, EventArgs e)
|
||||||
|
|
@ -95,21 +148,21 @@ namespace MathApp.Controls
|
||||||
int degree = (int)numOrder.Value;
|
int degree = (int)numOrder.Value;
|
||||||
Dictionary<string, decimal> points = new Dictionary<string, decimal>();
|
Dictionary<string, decimal> points = new Dictionary<string, decimal>();
|
||||||
|
|
||||||
foreach (var row in variableRows)
|
foreach (var chip in variableChips)
|
||||||
{
|
{
|
||||||
string v = row.Variable;
|
string v = chip.Variable;
|
||||||
if (string.IsNullOrWhiteSpace(v)) continue;
|
if (string.IsNullOrWhiteSpace(v)) continue;
|
||||||
|
|
||||||
string valNorm = row.Value.Replace(',', '.');
|
string valNorm = chip.Value.Replace(',', '.');
|
||||||
if (!decimal.TryParse(valNorm, NumberStyles.Any, CultureInfo.InvariantCulture, out decimal p))
|
if (!decimal.TryParse(valNorm, NumberStyles.Any, CultureInfo.InvariantCulture, out decimal p))
|
||||||
{
|
{
|
||||||
txtResult.Text = $"❌ '{v}' değişkeni için geçerli bir sayı giriniz.";
|
txtResult.Text = $"❌ '{v}' değişkeni için geçerli bir merkez sayısı giriniz.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (points.ContainsKey(v))
|
if (points.ContainsKey(v))
|
||||||
{
|
{
|
||||||
txtResult.Text = $"❌ '{v}' değişkeni birden fazla kez eklenmiş.";
|
txtResult.Text = $"❌ '{v}' değişkeni birden fazla kez tanımlanmış.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
points.Add(v, p);
|
points.Add(v, p);
|
||||||
|
|
@ -117,17 +170,175 @@ namespace MathApp.Controls
|
||||||
|
|
||||||
if (points.Count == 0)
|
if (points.Count == 0)
|
||||||
{
|
{
|
||||||
txtResult.Text = "⚠️ Lütfen en az bir değişken ekleyiniz.";
|
txtResult.Text = "⚠️ Lütfen en az bir değişken tanımlayınız.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var (fracPoly, factPoly, decPoly, details) = await Task.Run(() =>
|
var calcResult = await Task.Run(() =>
|
||||||
{
|
{
|
||||||
bool prevRad = Function.UseRadians;
|
bool prevRad = Function.UseRadians;
|
||||||
Function.UseRadians = true;
|
Function.UseRadians = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return NumericalMethods.MethodMultiVar_TaylorSeriesDetailed(eq, degree, points);
|
// 1. Detailed multi-variable evaluation
|
||||||
|
var detailed = NumericalMethods.MethodMultiVar_TaylorSeriesDetailed(eq, degree, points);
|
||||||
|
|
||||||
|
// 2. Compute f(a), Gradient, and Hessian
|
||||||
|
Function compiled = NumericalMethods.CompileFunction(eq);
|
||||||
|
decimal f0 = NumericalMethods.EvaluateCompiledMultiVar(compiled, points);
|
||||||
|
if (DecimalMath.Abs(f0) <= 0.00001m) f0 = 0m;
|
||||||
|
|
||||||
|
List<string> varNames = points.Keys.ToList();
|
||||||
|
int kVars = varNames.Count;
|
||||||
|
|
||||||
|
// Gradient components
|
||||||
|
decimal[] grad = new decimal[kVars];
|
||||||
|
List<string> linearTerms = new List<string>();
|
||||||
|
if (f0 != 0m) linearTerms.Add(NumericalMethods.FormatFractionalCoeff(f0));
|
||||||
|
|
||||||
|
for (int i = 0; i < kVars; i++)
|
||||||
|
{
|
||||||
|
int[] alpha1 = new int[kVars];
|
||||||
|
alpha1[i] = 1;
|
||||||
|
decimal d1 = NumericalMethods.ComputeMixedPartialDerivative(compiled, varNames, alpha1, points, 0.005m);
|
||||||
|
grad[i] = d1;
|
||||||
|
|
||||||
|
if (DecimalMath.Abs(d1) > 0.00001m)
|
||||||
|
{
|
||||||
|
string vName = varNames[i];
|
||||||
|
decimal aVal = points[vName];
|
||||||
|
string factor = aVal == 0m ? vName : (aVal > 0m ? $"({vName} - {aVal})" : $"({vName} + {DecimalMath.Abs(aVal)})");
|
||||||
|
var frac = NumericalMethods.ToFraction(d1);
|
||||||
|
string cStr = frac.HasValue ? (frac.Value.Denom == 1 ? $"{frac.Value.Num}" : $"{frac.Value.Num}/{frac.Value.Denom}") : Math.Round(d1, 4).ToString("0.####", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
|
string sign = d1 < 0 ? (linearTerms.Count == 0 ? "-" : "- ") : (linearTerms.Count == 0 ? "" : "+ ");
|
||||||
|
if (cStr == "1" || cStr == "-1")
|
||||||
|
linearTerms.Add($"{sign}{factor}");
|
||||||
|
else
|
||||||
|
linearTerms.Add($"{sign}{cStr.TrimStart('-')}*{factor}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string tangentPlaneStr = linearTerms.Count == 0 ? "0" : string.Join(" ", linearTerms);
|
||||||
|
|
||||||
|
// Hessian components (kVars x kVars)
|
||||||
|
decimal[,] hessian = new decimal[kVars, kVars];
|
||||||
|
List<string> quadTerms = new List<string>(linearTerms);
|
||||||
|
|
||||||
|
for (int i = 0; i < kVars; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < kVars; j++)
|
||||||
|
{
|
||||||
|
int[] alpha2 = new int[kVars];
|
||||||
|
alpha2[i]++;
|
||||||
|
alpha2[j]++;
|
||||||
|
decimal d2 = NumericalMethods.ComputeMixedPartialDerivative(compiled, varNames, alpha2, points, 0.005m);
|
||||||
|
hessian[i, j] = d2;
|
||||||
|
|
||||||
|
if (i <= j && DecimalMath.Abs(d2) > 0.00001m)
|
||||||
|
{
|
||||||
|
decimal coeff = i == j ? d2 / 2m : d2; // 1/2 * (2 * dx*dy) = dx*dy for cross terms
|
||||||
|
string vi = varNames[i];
|
||||||
|
string vj = varNames[j];
|
||||||
|
decimal ai = points[vi];
|
||||||
|
decimal aj = points[vj];
|
||||||
|
string fi = ai == 0m ? vi : (ai > 0m ? $"({vi} - {ai})" : $"({vi} + {DecimalMath.Abs(ai)})");
|
||||||
|
string fj = aj == 0m ? vj : (aj > 0m ? $"({vj} - {aj})" : $"({vj} + {DecimalMath.Abs(aj)})");
|
||||||
|
string varPart = i == j ? (ai == 0m ? $"{vi}^2" : $"{fi}^2") : $"{fi}*{fj}";
|
||||||
|
|
||||||
|
var frac = NumericalMethods.ToFraction(coeff);
|
||||||
|
string cStr = frac.HasValue ? (frac.Value.Denom == 1 ? $"{frac.Value.Num}" : $"{frac.Value.Num}/{frac.Value.Denom}") : Math.Round(coeff, 4).ToString("0.####", CultureInfo.InvariantCulture);
|
||||||
|
string sign = coeff < 0 ? (quadTerms.Count == 0 ? "-" : "- ") : (quadTerms.Count == 0 ? "" : "+ ");
|
||||||
|
if (cStr == "1" || cStr == "-1")
|
||||||
|
quadTerms.Add($"{sign}{varPart}");
|
||||||
|
else
|
||||||
|
quadTerms.Add($"{sign}{cStr.TrimStart('-')}*{varPart}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string quadPolyStr = quadTerms.Count == 0 ? "0" : string.Join(" ", quadTerms);
|
||||||
|
|
||||||
|
// Hessian Determinant / Extremum diagnosis for 2 variables
|
||||||
|
string hessianDiagnosis = "";
|
||||||
|
if (kVars == 2)
|
||||||
|
{
|
||||||
|
decimal fxx = hessian[0, 0];
|
||||||
|
decimal fyy = hessian[1, 1];
|
||||||
|
decimal fxy = hessian[0, 1];
|
||||||
|
decimal detH = (fxx * fyy) - (fxy * fxy);
|
||||||
|
|
||||||
|
StringBuilder hsb = new StringBuilder();
|
||||||
|
hsb.AppendLine($"Hessian H(a) = [ [{Math.Round(fxx, 4)}, {Math.Round(fxy, 4)}], [{Math.Round(fxy, 4)}, {Math.Round(fyy, 4)}] ]");
|
||||||
|
hsb.Append($"det(H) = fxx·fyy - (fxy)² = {Math.Round(detH, 5)} => ");
|
||||||
|
|
||||||
|
if (detH > 0.0001m)
|
||||||
|
{
|
||||||
|
if (fxx > 0.0001m) hsb.Append("det(H) > 0 ve fxx > 0 => ✓ YEREL MİNİMUM");
|
||||||
|
else if (fxx < -0.0001m) hsb.Append("det(H) > 0 ve fxx < 0 => ✓ YEREL MAKSİMUM");
|
||||||
|
else hsb.Append("det(H) > 0 => Ekstremum Noktası");
|
||||||
|
}
|
||||||
|
else if (detH < -0.0001m)
|
||||||
|
{
|
||||||
|
hsb.Append("det(H) < 0 => ⚠️ EYER NOKTASI (Saddle Point)");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hsb.Append("det(H) ≈ 0 => İkinci Türev Testi Sonuçsuz");
|
||||||
|
}
|
||||||
|
hessianDiagnosis = hsb.ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StringBuilder hsb = new StringBuilder();
|
||||||
|
hsb.Append("Hessian H(a) [" + kVars + "×" + kVars + "]: ");
|
||||||
|
for (int r = 0; r < kVars; r++)
|
||||||
|
{
|
||||||
|
hsb.Append("[ ");
|
||||||
|
for (int c = 0; c < kVars; c++)
|
||||||
|
{
|
||||||
|
hsb.Append(Math.Round(hessian[r, c], 3).ToString(CultureInfo.InvariantCulture));
|
||||||
|
if (c < kVars - 1) hsb.Append(", ");
|
||||||
|
}
|
||||||
|
hsb.Append(" ] ");
|
||||||
|
}
|
||||||
|
hessianDiagnosis = hsb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gradient string
|
||||||
|
string gradStr = "Gradyan ∇f(a) = [ " + string.Join(", ", grad.Select(g => Math.Round(g, 4).ToString("0.####", CultureInfo.InvariantCulture))) + " ]ᵀ";
|
||||||
|
|
||||||
|
// Parse table rows from detailed lines
|
||||||
|
List<(string deg, string op, string val, string denom, string fracC, string decC, string term)> gridRows = new List<(string, string, string, string, string, string, string)>();
|
||||||
|
foreach (var det in detailed.Details)
|
||||||
|
{
|
||||||
|
if (det.StartsWith("•"))
|
||||||
|
{
|
||||||
|
string clean = det.Substring(1).Trim();
|
||||||
|
// Example: "∂^1f / ∂x = 1.00000 | Payda: 1 => Kesirli Katsayı: 1 | Ondalık: 1"
|
||||||
|
string[] parts = clean.Split(new string[] { "=", "|", "=>" }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (parts.Length >= 4)
|
||||||
|
{
|
||||||
|
string op = parts[0].Trim();
|
||||||
|
string val = parts[1].Trim();
|
||||||
|
string payda = parts[2].Replace("Payda:", "").Trim();
|
||||||
|
string fracC = parts[3].Replace("Kesirli Katsayı:", "").Trim();
|
||||||
|
string decC = parts.Length > 4 ? parts[4].Replace("Ondalık:", "").Trim() : fracC;
|
||||||
|
|
||||||
|
string degStr = "1";
|
||||||
|
if (op.Contains("∂^"))
|
||||||
|
{
|
||||||
|
int p1 = op.IndexOf("∂^") + 2;
|
||||||
|
int p2 = op.IndexOf("f");
|
||||||
|
if (p2 > p1) degStr = op.Substring(p1, p2 - p1);
|
||||||
|
}
|
||||||
|
|
||||||
|
gridRows.Add((degStr, op, val, payda, fracC, decC, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (detailed.Fractional, detailed.Factorial, detailed.Decimal, detailed.Details, tangentPlaneStr, quadPolyStr, gradStr, hessianDiagnosis, gridRows);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -135,6 +346,27 @@ namespace MathApp.Controls
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_lastTangentPlane = $"L({string.Join(", ", points.Keys)}) = {calcResult.tangentPlaneStr}";
|
||||||
|
_lastFullPoly = calcResult.Fractional;
|
||||||
|
|
||||||
|
// Update Block 1: Tangent Plane
|
||||||
|
lblTangentValue.Text = _lastTangentPlane;
|
||||||
|
lblGradientValue.Text = calcResult.gradStr;
|
||||||
|
|
||||||
|
// Update Block 2: Hessian
|
||||||
|
lblHessianValue.Text = $"Q({string.Join(", ", points.Keys)}) = {calcResult.quadPolyStr}";
|
||||||
|
lblHessianDet.Text = calcResult.hessianDiagnosis;
|
||||||
|
|
||||||
|
// Update Block 3: Full Polynomial
|
||||||
|
lblFullPolyValue.Text = $"T_{degree}({string.Join(", ", points.Keys)}) = {calcResult.Fractional}";
|
||||||
|
|
||||||
|
// Populate dgvMultiTerms
|
||||||
|
dgvMultiTerms.Rows.Clear();
|
||||||
|
foreach (var row in calcResult.gridRows)
|
||||||
|
{
|
||||||
|
dgvMultiTerms.Rows.Add(row.deg, row.op, row.val, row.denom, row.fracC, row.decC, row.term);
|
||||||
|
}
|
||||||
|
|
||||||
string varsList = string.Join(", ", points.Keys);
|
string varsList = string.Join(", ", points.Keys);
|
||||||
string centerList = string.Join(", ", points.Select(kv => $"{kv.Key}₀ = {kv.Value}"));
|
string centerList = string.Join(", ", points.Select(kv => $"{kv.Key}₀ = {kv.Value}"));
|
||||||
|
|
||||||
|
|
@ -143,24 +375,33 @@ namespace MathApp.Controls
|
||||||
sb.AppendLine($"Fonksiyon : f({varsList}) = {eq}");
|
sb.AppendLine($"Fonksiyon : f({varsList}) = {eq}");
|
||||||
sb.AppendLine($"Merkez : ({centerList})");
|
sb.AppendLine($"Merkez : ({centerList})");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("📐 1) KESİRLİ SADELEŞTİRİLMİŞ FORM:");
|
sb.AppendLine("📐 1) DOĞRUSAL YAKLAŞIM / TEĞET DÜZLEM (L):");
|
||||||
sb.AppendLine($" T_{degree}({varsList}) = {fracPoly}");
|
sb.AppendLine($" {_lastTangentPlane}");
|
||||||
|
sb.AppendLine($" {calcResult.gradStr}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("📜 2) ANALİTİK FAKTÖRİYELLİ FORM [ (1/α!) · ∂^|α|f / ∂x^α ]:");
|
sb.AppendLine("⚡ 2) KUADRATİK YAKLAŞIM & HESSIAN FORMU (Q):");
|
||||||
sb.AppendLine($" T_{degree}({varsList}) = {factPoly}");
|
sb.AppendLine($" Q({varsList}) = {calcResult.quadPolyStr}");
|
||||||
|
sb.AppendLine($" {calcResult.hessianDiagnosis}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("🔢 3) ONDALIKLI SAYISAL YAKLAŞIM:");
|
sb.AppendLine("🌟 3) KESİRLİ SADELEŞTİRİLMİŞ TAM POLİNOM (T_n):");
|
||||||
sb.AppendLine($" T_{degree}({varsList}) = {decPoly}");
|
sb.AppendLine($" T_{degree}({varsList}) = {calcResult.Fractional}");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine("📜 4) ANALİTİK FAKTÖRİYELLİ FORM [ (1/α!) · ∂^|α|f / ∂x^α ]:");
|
||||||
|
sb.AppendLine($" T_{degree}({varsList}) = {calcResult.Factorial}");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine("🔢 5) ONDALIKLI SAYISAL YAKLAŞIM:");
|
||||||
|
sb.AppendLine($" T_{degree}({varsList}) = {calcResult.Decimal}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine(new string('=', 65));
|
sb.AppendLine(new string('=', 65));
|
||||||
sb.AppendLine("=== KISMİ TÜREVLER, PAYDA VE TERİM KATSAYILARI DETAYI ===");
|
sb.AppendLine("=== KISMİ TÜREVLER, PAYDA VE TERİM KATSAYILARI DETAYI ===");
|
||||||
sb.AppendLine(string.Join(Environment.NewLine, details));
|
sb.AppendLine(string.Join(Environment.NewLine, calcResult.Details));
|
||||||
|
|
||||||
txtResult.Text = sb.ToString();
|
txtResult.Text = sb.ToString();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
txtResult.Text = "❌ Hata: " + ex.Message;
|
txtResult.Text = "❌ Hata: " + ex.Message;
|
||||||
|
lblFullPolyValue.Text = "Hata Oluştu: " + ex.Message;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -171,6 +412,93 @@ namespace MathApp.Controls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class VariableChip
|
||||||
|
{
|
||||||
|
public Panel Panel { get; private set; }
|
||||||
|
public TextBox TxtVariable { get; private set; }
|
||||||
|
public TextBox TxtValue { get; private set; }
|
||||||
|
public EventHandler OnRemove;
|
||||||
|
|
||||||
|
public string Variable => TxtVariable.Text.Trim();
|
||||||
|
public string Value
|
||||||
|
{
|
||||||
|
get => TxtValue.Text.Trim();
|
||||||
|
set => TxtValue.Text = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VariableChip(string varName, string val)
|
||||||
|
{
|
||||||
|
Panel = new Panel
|
||||||
|
{
|
||||||
|
Size = new Size(180, 32),
|
||||||
|
BackColor = Color.FromArgb(24, 33, 52),
|
||||||
|
Margin = new Padding(0, 0, 8, 4)
|
||||||
|
};
|
||||||
|
|
||||||
|
Label lblVar = new Label
|
||||||
|
{
|
||||||
|
Text = "Var:",
|
||||||
|
Location = new Point(4, 7),
|
||||||
|
AutoSize = true,
|
||||||
|
ForeColor = Color.FromArgb(148, 163, 184),
|
||||||
|
Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold)
|
||||||
|
};
|
||||||
|
|
||||||
|
TxtVariable = new TextBox
|
||||||
|
{
|
||||||
|
Text = varName,
|
||||||
|
Location = new Point(32, 5),
|
||||||
|
Size = new Size(32, 22),
|
||||||
|
BackColor = Color.FromArgb(15, 23, 42),
|
||||||
|
ForeColor = Color.FromArgb(56, 189, 248),
|
||||||
|
BorderStyle = BorderStyle.FixedSingle,
|
||||||
|
Font = new Font("Consolas", 9.5F, FontStyle.Bold),
|
||||||
|
TextAlign = HorizontalAlignment.Center
|
||||||
|
};
|
||||||
|
|
||||||
|
Label lblVal = new Label
|
||||||
|
{
|
||||||
|
Text = "x₀:",
|
||||||
|
Location = new Point(70, 7),
|
||||||
|
AutoSize = true,
|
||||||
|
ForeColor = Color.FromArgb(148, 163, 184),
|
||||||
|
Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold)
|
||||||
|
};
|
||||||
|
|
||||||
|
TxtValue = new TextBox
|
||||||
|
{
|
||||||
|
Text = val,
|
||||||
|
Location = new Point(94, 5),
|
||||||
|
Size = new Size(54, 22),
|
||||||
|
BackColor = Color.FromArgb(15, 23, 42),
|
||||||
|
ForeColor = Color.White,
|
||||||
|
BorderStyle = BorderStyle.FixedSingle,
|
||||||
|
Font = new Font("Consolas", 9.5F),
|
||||||
|
TextAlign = HorizontalAlignment.Center
|
||||||
|
};
|
||||||
|
|
||||||
|
Button btnRemove = new Button
|
||||||
|
{
|
||||||
|
Text = "✕",
|
||||||
|
Location = new Point(154, 5),
|
||||||
|
Size = new Size(22, 22),
|
||||||
|
BackColor = Color.FromArgb(153, 27, 27),
|
||||||
|
ForeColor = Color.White,
|
||||||
|
FlatStyle = FlatStyle.Flat,
|
||||||
|
Font = new Font("Segoe UI Bold", 7.5F, FontStyle.Bold),
|
||||||
|
Cursor = Cursors.Hand
|
||||||
|
};
|
||||||
|
btnRemove.FlatAppearance.BorderSize = 0;
|
||||||
|
btnRemove.Click += (s, e) => OnRemove?.Invoke(this, EventArgs.Empty);
|
||||||
|
|
||||||
|
Panel.Controls.Add(lblVar);
|
||||||
|
Panel.Controls.Add(TxtVariable);
|
||||||
|
Panel.Controls.Add(lblVal);
|
||||||
|
Panel.Controls.Add(TxtValue);
|
||||||
|
Panel.Controls.Add(btnRemove);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class VariableInputRow
|
public class VariableInputRow
|
||||||
{
|
{
|
||||||
public Panel Panel { get; private set; }
|
public Panel Panel { get; private set; }
|
||||||
|
|
@ -213,7 +541,7 @@ namespace MathApp.Controls
|
||||||
|
|
||||||
Label lblVal = new Label
|
Label lblVal = new Label
|
||||||
{
|
{
|
||||||
Text = "Merkez Noktası:",
|
Text = "Nokta:",
|
||||||
Location = new Point(185, 8),
|
Location = new Point(185, 8),
|
||||||
AutoSize = true,
|
AutoSize = true,
|
||||||
ForeColor = ThemeHelper.LightText,
|
ForeColor = ThemeHelper.LightText,
|
||||||
|
|
@ -223,7 +551,7 @@ namespace MathApp.Controls
|
||||||
TxtValue = new TextBox
|
TxtValue = new TextBox
|
||||||
{
|
{
|
||||||
Text = val,
|
Text = val,
|
||||||
Location = new Point(295, 5),
|
Location = new Point(245, 5),
|
||||||
Size = new Size(100, 25),
|
Size = new Size(100, 25),
|
||||||
BackColor = ThemeHelper.InputBackground,
|
BackColor = ThemeHelper.InputBackground,
|
||||||
ForeColor = Color.White,
|
ForeColor = Color.White,
|
||||||
|
|
@ -235,7 +563,7 @@ namespace MathApp.Controls
|
||||||
Button btnRemove = new Button
|
Button btnRemove = new Button
|
||||||
{
|
{
|
||||||
Text = "✕ Sil",
|
Text = "✕ Sil",
|
||||||
Location = new Point(415, 4),
|
Location = new Point(365, 4),
|
||||||
Size = new Size(65, 26),
|
Size = new Size(65, 26),
|
||||||
BackColor = Color.FromArgb(153, 27, 27),
|
BackColor = Color.FromArgb(153, 27, 27),
|
||||||
ForeColor = Color.White,
|
ForeColor = Color.White,
|
||||||
|
|
|
||||||
|
|
@ -20,15 +20,19 @@ namespace MathApp.Controls
|
||||||
{
|
{
|
||||||
this.pnlHeader = ThemeHelper.CreateHeaderPanel(
|
this.pnlHeader = ThemeHelper.CreateHeaderPanel(
|
||||||
"Taylor Serisi Hesaplayıcı (Tek Değişkenli)",
|
"Taylor Serisi Hesaplayıcı (Tek Değişkenli)",
|
||||||
"Bir f(x) fonksiyonunun verilen a merkez noktasındaki n. dereceden Taylor / Maclaurin polinom açılımı ve türev katsayıları.");
|
"Bir f(x) fonksiyonunun verilen a merkez noktasındaki n. dereceden Taylor / Maclaurin polinom açılımı, katsayıları ve hata analizi.");
|
||||||
|
|
||||||
this.pnlContent = new Panel();
|
this.pnlContent = new Panel();
|
||||||
this.pnlPresets = new FlowLayoutPanel();
|
this.pnlPresets = new FlowLayoutPanel();
|
||||||
this.lblPresets = new Label();
|
this.lblPresets = new Label();
|
||||||
this.btnExSin = ThemeHelper.CreateExampleChip("Örnek 1: sin(x) (a=0, n=5)");
|
this.btnExSin = ThemeHelper.CreateExampleChip("Örnek 1: sin(x) (a=0, n=5)");
|
||||||
this.btnExExp = ThemeHelper.CreateExampleChip("Örnek 2: exp(x) (a=0, n=4)");
|
this.btnExCos = ThemeHelper.CreateExampleChip("Örnek 2: cos(x) (a=0, n=6)");
|
||||||
this.btnExLn = ThemeHelper.CreateExampleChip("Örnek 3: ln(x) (a=1, n=4)");
|
this.btnExExp = ThemeHelper.CreateExampleChip("Örnek 3: exp(x) (a=0, n=5)");
|
||||||
|
this.btnExLn = ThemeHelper.CreateExampleChip("Örnek 4: ln(1+x) (a=0, n=4)");
|
||||||
|
this.btnExGeom = ThemeHelper.CreateExampleChip("Örnek 5: 1/(1-x) (a=0, n=5)");
|
||||||
|
this.btnExAtan = ThemeHelper.CreateExampleChip("Örnek 6: atan(x) (a=0, n=5)");
|
||||||
|
|
||||||
|
// Input Card
|
||||||
this.pnlInputCard = new Panel();
|
this.pnlInputCard = new Panel();
|
||||||
this.lblFunction = new Label();
|
this.lblFunction = new Label();
|
||||||
this.txtFunction = new TextBox();
|
this.txtFunction = new TextBox();
|
||||||
|
|
@ -36,28 +40,55 @@ namespace MathApp.Controls
|
||||||
this.txtVariable = new TextBox();
|
this.txtVariable = new TextBox();
|
||||||
this.lblCenterPoint = new Label();
|
this.lblCenterPoint = new Label();
|
||||||
this.txtCenterPoint = new TextBox();
|
this.txtCenterPoint = new TextBox();
|
||||||
|
this.btnMaclaurin = new Button();
|
||||||
this.lblOrder = new Label();
|
this.lblOrder = new Label();
|
||||||
this.numOrder = new NumericUpDown();
|
this.numOrder = new NumericUpDown();
|
||||||
this.btnCalculate = ThemeHelper.CreateActionButton("📐 Taylor Polinomunu Hesapla", 220, 36, true);
|
this.btnCalculate = ThemeHelper.CreateActionButton("📐 Taylor Polinomunu Hesapla", 230, 36, true);
|
||||||
|
|
||||||
// Hero Polynomial Card
|
// Hero Polynomial Card
|
||||||
this.pnlHeroPoly = new Panel();
|
this.pnlHeroPoly = new Panel();
|
||||||
this.lblHeroPolyTitle = new Label();
|
this.lblHeroPolyTitle = new Label();
|
||||||
this.lblHeroPolyValue = new Label();
|
this.lblHeroPolyValue = new Label();
|
||||||
this.btnCopyPoly = ThemeHelper.CreateCopyButton("📋 Polinomu Kopyala");
|
this.pnlHeroButtons = new FlowLayoutPanel();
|
||||||
|
this.btnNavToGraph = new Button();
|
||||||
|
this.btnCopyPoly = ThemeHelper.CreateCopyButton("📋 Kopyala");
|
||||||
|
this.btnCopyLatex = ThemeHelper.CreateCopyButton("LaTeX");
|
||||||
|
|
||||||
this.lblResult = new Label();
|
// Split Container for Canvas + Tabs
|
||||||
|
this.splitVisual = new SplitContainer();
|
||||||
|
this.pnlMiniCanvas = new Panel();
|
||||||
|
this.lblCanvasTitle = new Label();
|
||||||
|
|
||||||
|
// Tabs for Table, Error Analysis, Full Text
|
||||||
|
this.tabResults = new TabControl();
|
||||||
|
this.tabTable = new TabPage();
|
||||||
|
this.dgvTerms = new DataGridView();
|
||||||
|
this.tabError = new TabPage();
|
||||||
|
this.lblLagrangeTheory = new Label();
|
||||||
|
this.dgvError = new DataGridView();
|
||||||
|
this.tabReport = new TabPage();
|
||||||
this.txtResult = new TextBox();
|
this.txtResult = new TextBox();
|
||||||
|
|
||||||
this.pnlContent.SuspendLayout();
|
this.pnlContent.SuspendLayout();
|
||||||
this.pnlInputCard.SuspendLayout();
|
this.pnlInputCard.SuspendLayout();
|
||||||
this.pnlHeroPoly.SuspendLayout();
|
this.pnlHeroPoly.SuspendLayout();
|
||||||
|
this.pnlHeroButtons.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numOrder)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.numOrder)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitVisual)).BeginInit();
|
||||||
|
this.splitVisual.Panel1.SuspendLayout();
|
||||||
|
this.splitVisual.Panel2.SuspendLayout();
|
||||||
|
this.splitVisual.SuspendLayout();
|
||||||
|
this.tabResults.SuspendLayout();
|
||||||
|
this.tabTable.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgvTerms)).BeginInit();
|
||||||
|
this.tabError.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgvError)).BeginInit();
|
||||||
|
this.tabReport.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
|
||||||
this.pnlContent.Dock = DockStyle.Fill;
|
this.pnlContent.Dock = DockStyle.Fill;
|
||||||
this.pnlContent.BackColor = ThemeHelper.DarkBackground;
|
this.pnlContent.BackColor = ThemeHelper.DarkBackground;
|
||||||
this.pnlContent.Padding = new Padding(24, 12, 24, 20);
|
this.pnlContent.Padding = new Padding(20, 10, 20, 16);
|
||||||
this.pnlContent.AutoScroll = true;
|
this.pnlContent.AutoScroll = true;
|
||||||
|
|
||||||
// Presets
|
// Presets
|
||||||
|
|
@ -67,17 +98,20 @@ namespace MathApp.Controls
|
||||||
this.lblPresets.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
this.lblPresets.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
this.lblPresets.Margin = new Padding(0, 5, 8, 0);
|
this.lblPresets.Margin = new Padding(0, 5, 8, 0);
|
||||||
|
|
||||||
this.pnlPresets.Location = new Point(24, 10);
|
this.pnlPresets.Location = new Point(20, 8);
|
||||||
this.pnlPresets.Size = new Size(860, 32);
|
this.pnlPresets.Size = new Size(880, 32);
|
||||||
this.pnlPresets.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
this.pnlPresets.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
this.pnlPresets.Controls.Add(this.lblPresets);
|
this.pnlPresets.Controls.Add(this.lblPresets);
|
||||||
this.pnlPresets.Controls.Add(this.btnExSin);
|
this.pnlPresets.Controls.Add(this.btnExSin);
|
||||||
|
this.pnlPresets.Controls.Add(this.btnExCos);
|
||||||
this.pnlPresets.Controls.Add(this.btnExExp);
|
this.pnlPresets.Controls.Add(this.btnExExp);
|
||||||
this.pnlPresets.Controls.Add(this.btnExLn);
|
this.pnlPresets.Controls.Add(this.btnExLn);
|
||||||
|
this.pnlPresets.Controls.Add(this.btnExGeom);
|
||||||
|
this.pnlPresets.Controls.Add(this.btnExAtan);
|
||||||
|
|
||||||
// Input Card
|
// Input Card
|
||||||
this.pnlInputCard.Location = new Point(24, 46);
|
this.pnlInputCard.Location = new Point(20, 44);
|
||||||
this.pnlInputCard.Size = new Size(860, 96);
|
this.pnlInputCard.Size = new Size(880, 88);
|
||||||
this.pnlInputCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
this.pnlInputCard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
this.pnlInputCard.BackColor = ThemeHelper.CardBackground;
|
this.pnlInputCard.BackColor = ThemeHelper.CardBackground;
|
||||||
this.pnlInputCard.Padding = new Padding(14, 10, 14, 10);
|
this.pnlInputCard.Padding = new Padding(14, 10, 14, 10);
|
||||||
|
|
@ -87,7 +121,7 @@ namespace MathApp.Controls
|
||||||
l.Text = text;
|
l.Text = text;
|
||||||
l.Location = loc;
|
l.Location = loc;
|
||||||
l.AutoSize = true;
|
l.AutoSize = true;
|
||||||
l.Font = new Font("Segoe UI", 9F, FontStyle.Regular);
|
l.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
l.ForeColor = ThemeHelper.LightText;
|
l.ForeColor = ThemeHelper.LightText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,25 +136,35 @@ namespace MathApp.Controls
|
||||||
t.Text = def;
|
t.Text = def;
|
||||||
}
|
}
|
||||||
|
|
||||||
StyleLabel(this.lblFunction, "Fonksiyon f(x):", new Point(14, 16));
|
StyleLabel(this.lblFunction, "Fonksiyon f(x):", new Point(14, 14));
|
||||||
StyleInput(this.txtFunction, "sin(x)", new Point(110, 13), new Size(320, 26));
|
StyleInput(this.txtFunction, "sin(x)", new Point(110, 11), new Size(290, 26));
|
||||||
|
|
||||||
StyleLabel(this.lblVariable, "Değişken:", new Point(445, 16));
|
StyleLabel(this.lblVariable, "Değişken:", new Point(410, 14));
|
||||||
StyleInput(this.txtVariable, "x", new Point(510, 13), new Size(50, 26));
|
StyleInput(this.txtVariable, "x", new Point(475, 11), new Size(42, 26));
|
||||||
|
|
||||||
StyleLabel(this.lblCenterPoint, "Merkez (a):", new Point(575, 16));
|
StyleLabel(this.lblCenterPoint, "Merkez (a):", new Point(530, 14));
|
||||||
StyleInput(this.txtCenterPoint, "0", new Point(650, 13), new Size(60, 26));
|
StyleInput(this.txtCenterPoint, "0", new Point(605, 11), new Size(50, 26));
|
||||||
|
|
||||||
StyleLabel(this.lblOrder, "Derece (n):", new Point(14, 56));
|
this.btnMaclaurin.Text = "a=0 (Maclaurin)";
|
||||||
this.numOrder.Location = new Point(110, 53);
|
this.btnMaclaurin.Location = new Point(660, 11);
|
||||||
|
this.btnMaclaurin.Size = new Size(110, 26);
|
||||||
|
this.btnMaclaurin.BackColor = Color.FromArgb(33, 44, 70);
|
||||||
|
this.btnMaclaurin.ForeColor = Color.FromArgb(186, 230, 253);
|
||||||
|
this.btnMaclaurin.FlatStyle = FlatStyle.Flat;
|
||||||
|
this.btnMaclaurin.FlatAppearance.BorderSize = 0;
|
||||||
|
this.btnMaclaurin.Font = new Font("Segoe UI", 8F);
|
||||||
|
this.btnMaclaurin.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
|
StyleLabel(this.lblOrder, "Derece (n):", new Point(14, 52));
|
||||||
|
this.numOrder.Location = new Point(110, 50);
|
||||||
this.numOrder.Size = new Size(55, 26);
|
this.numOrder.Size = new Size(55, 26);
|
||||||
this.numOrder.Minimum = 1;
|
this.numOrder.Minimum = 1;
|
||||||
this.numOrder.Maximum = 12;
|
this.numOrder.Maximum = 20;
|
||||||
this.numOrder.Value = 5;
|
this.numOrder.Value = 5;
|
||||||
this.numOrder.BackColor = Color.FromArgb(15, 23, 42);
|
this.numOrder.BackColor = Color.FromArgb(15, 23, 42);
|
||||||
this.numOrder.ForeColor = Color.White;
|
this.numOrder.ForeColor = Color.White;
|
||||||
|
|
||||||
this.btnCalculate.Location = new Point(180, 50);
|
this.btnCalculate.Location = new Point(180, 46);
|
||||||
|
|
||||||
this.pnlInputCard.Controls.Add(this.lblFunction);
|
this.pnlInputCard.Controls.Add(this.lblFunction);
|
||||||
this.pnlInputCard.Controls.Add(this.txtFunction);
|
this.pnlInputCard.Controls.Add(this.txtFunction);
|
||||||
|
|
@ -128,59 +172,134 @@ namespace MathApp.Controls
|
||||||
this.pnlInputCard.Controls.Add(this.txtVariable);
|
this.pnlInputCard.Controls.Add(this.txtVariable);
|
||||||
this.pnlInputCard.Controls.Add(this.lblCenterPoint);
|
this.pnlInputCard.Controls.Add(this.lblCenterPoint);
|
||||||
this.pnlInputCard.Controls.Add(this.txtCenterPoint);
|
this.pnlInputCard.Controls.Add(this.txtCenterPoint);
|
||||||
|
this.pnlInputCard.Controls.Add(this.btnMaclaurin);
|
||||||
this.pnlInputCard.Controls.Add(this.lblOrder);
|
this.pnlInputCard.Controls.Add(this.lblOrder);
|
||||||
this.pnlInputCard.Controls.Add(this.numOrder);
|
this.pnlInputCard.Controls.Add(this.numOrder);
|
||||||
this.pnlInputCard.Controls.Add(this.btnCalculate);
|
this.pnlInputCard.Controls.Add(this.btnCalculate);
|
||||||
|
|
||||||
// Hero Polynomial Card
|
// Hero Polynomial Card
|
||||||
this.pnlHeroPoly.Location = new Point(24, 150);
|
this.pnlHeroPoly.Location = new Point(20, 138);
|
||||||
this.pnlHeroPoly.Size = new Size(860, 70);
|
this.pnlHeroPoly.Size = new Size(880, 78);
|
||||||
this.pnlHeroPoly.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
this.pnlHeroPoly.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
this.pnlHeroPoly.BackColor = Color.FromArgb(20, 30, 48);
|
this.pnlHeroPoly.BackColor = Color.FromArgb(20, 30, 48);
|
||||||
this.pnlHeroPoly.Padding = new Padding(16, 8, 16, 8);
|
this.pnlHeroPoly.Padding = new Padding(16, 8, 16, 8);
|
||||||
|
|
||||||
this.lblHeroPolyTitle.Text = "HESAPLANAN TAYLOR POLİNOMU";
|
this.lblHeroPolyTitle.Text = "HESAPLANAN TAYLOR POLİNOMU (Pn(x))";
|
||||||
this.lblHeroPolyTitle.Location = new Point(14, 8);
|
this.lblHeroPolyTitle.Location = new Point(14, 8);
|
||||||
this.lblHeroPolyTitle.AutoSize = true;
|
this.lblHeroPolyTitle.AutoSize = true;
|
||||||
this.lblHeroPolyTitle.Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold);
|
this.lblHeroPolyTitle.Font = new Font("Segoe UI Semibold", 8F, FontStyle.Bold);
|
||||||
this.lblHeroPolyTitle.ForeColor = Color.FromArgb(148, 163, 184);
|
this.lblHeroPolyTitle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
|
||||||
this.lblHeroPolyValue.Text = "P_n(x) = —";
|
this.lblHeroPolyValue.Text = "P_n(x) = —";
|
||||||
this.lblHeroPolyValue.Location = new Point(12, 26);
|
this.lblHeroPolyValue.Location = new Point(12, 28);
|
||||||
this.lblHeroPolyValue.AutoSize = true;
|
this.lblHeroPolyValue.AutoSize = false;
|
||||||
this.lblHeroPolyValue.Font = new Font("Consolas", 12F, FontStyle.Bold);
|
this.lblHeroPolyValue.Size = new Size(550, 42);
|
||||||
|
this.lblHeroPolyValue.Font = new Font("Consolas", 11.5F, FontStyle.Bold);
|
||||||
this.lblHeroPolyValue.ForeColor = Color.FromArgb(52, 211, 153);
|
this.lblHeroPolyValue.ForeColor = Color.FromArgb(52, 211, 153);
|
||||||
|
|
||||||
this.btnCopyPoly.Location = new Point(700, 18);
|
this.pnlHeroButtons.FlowDirection = FlowDirection.RightToLeft;
|
||||||
this.btnCopyPoly.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
this.pnlHeroButtons.Location = new Point(570, 14);
|
||||||
|
this.pnlHeroButtons.Size = new Size(300, 52);
|
||||||
|
this.pnlHeroButtons.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
|
||||||
|
this.btnNavToGraph.Text = "📈 Grafikte Göster";
|
||||||
|
this.btnNavToGraph.Size = new Size(130, 32);
|
||||||
|
this.btnNavToGraph.BackColor = Color.FromArgb(16, 185, 129);
|
||||||
|
this.btnNavToGraph.ForeColor = Color.White;
|
||||||
|
this.btnNavToGraph.FlatStyle = FlatStyle.Flat;
|
||||||
|
this.btnNavToGraph.FlatAppearance.BorderSize = 0;
|
||||||
|
this.btnNavToGraph.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
|
this.btnNavToGraph.Cursor = Cursors.Hand;
|
||||||
|
|
||||||
|
this.btnCopyPoly.Height = 32;
|
||||||
|
this.btnCopyLatex.Height = 32;
|
||||||
|
|
||||||
|
this.pnlHeroButtons.Controls.Add(this.btnNavToGraph);
|
||||||
|
this.pnlHeroButtons.Controls.Add(this.btnCopyLatex);
|
||||||
|
this.pnlHeroButtons.Controls.Add(this.btnCopyPoly);
|
||||||
|
|
||||||
this.pnlHeroPoly.Controls.Add(this.lblHeroPolyTitle);
|
this.pnlHeroPoly.Controls.Add(this.lblHeroPolyTitle);
|
||||||
this.pnlHeroPoly.Controls.Add(this.lblHeroPolyValue);
|
this.pnlHeroPoly.Controls.Add(this.lblHeroPolyValue);
|
||||||
this.pnlHeroPoly.Controls.Add(this.btnCopyPoly);
|
this.pnlHeroPoly.Controls.Add(this.pnlHeroButtons);
|
||||||
|
|
||||||
// Result
|
// Split Container for Mini Canvas and Tabbed Details
|
||||||
this.lblResult.Text = "📊 Noktadaki Sayısal Türevler ve Terim Katsayıları:";
|
this.splitVisual.Location = new Point(20, 222);
|
||||||
this.lblResult.Location = new Point(24, 230);
|
this.splitVisual.Size = new Size(880, 420);
|
||||||
this.lblResult.AutoSize = true;
|
this.splitVisual.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
this.lblResult.Font = new Font("Segoe UI Semibold", 9.5F, FontStyle.Bold);
|
this.splitVisual.Orientation = Orientation.Vertical;
|
||||||
this.lblResult.ForeColor = ThemeHelper.LightText;
|
this.splitVisual.SplitterDistance = 300;
|
||||||
|
this.splitVisual.SplitterWidth = 8;
|
||||||
|
this.splitVisual.BackColor = ThemeHelper.DarkBackground;
|
||||||
|
|
||||||
this.txtResult.Location = new Point(24, 254);
|
// Panel 1: Mini 2D Convergence Canvas
|
||||||
this.txtResult.Size = new Size(860, 320);
|
this.splitVisual.Panel1.BackColor = Color.FromArgb(18, 26, 43);
|
||||||
this.txtResult.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
this.splitVisual.Panel1.Padding = new Padding(4);
|
||||||
this.txtResult.BackColor = Color.FromArgb(15, 23, 42);
|
|
||||||
this.txtResult.BorderStyle = BorderStyle.FixedSingle;
|
this.lblCanvasTitle.Text = "📐 2D Yakınsama Önizleme";
|
||||||
|
this.lblCanvasTitle.Dock = DockStyle.Top;
|
||||||
|
this.lblCanvasTitle.Height = 24;
|
||||||
|
this.lblCanvasTitle.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
|
this.lblCanvasTitle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
this.lblCanvasTitle.TextAlign = ContentAlignment.MiddleLeft;
|
||||||
|
|
||||||
|
this.pnlMiniCanvas.Dock = DockStyle.Fill;
|
||||||
|
this.pnlMiniCanvas.BackColor = Color.FromArgb(11, 15, 28);
|
||||||
|
this.pnlMiniCanvas.DoubleBuffered(true);
|
||||||
|
|
||||||
|
this.splitVisual.Panel1.Controls.Add(this.pnlMiniCanvas);
|
||||||
|
this.splitVisual.Panel1.Controls.Add(this.lblCanvasTitle);
|
||||||
|
|
||||||
|
// Panel 2: Tabbed Results
|
||||||
|
this.splitVisual.Panel2.Controls.Add(this.tabResults);
|
||||||
|
this.tabResults.Dock = DockStyle.Fill;
|
||||||
|
this.tabResults.Font = new Font("Segoe UI Semibold", 9F, FontStyle.Bold);
|
||||||
|
|
||||||
|
// Tab 1: Katsayılar & Türevler Tablosu
|
||||||
|
this.tabTable.Text = "Katsayılar & Türev Tablosu";
|
||||||
|
this.tabTable.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabTable.Padding = new Padding(6);
|
||||||
|
SetupGrid(this.dgvTerms);
|
||||||
|
this.tabTable.Controls.Add(this.dgvTerms);
|
||||||
|
|
||||||
|
// Tab 2: Hata Analizi
|
||||||
|
this.tabError.Text = "Hata & Lagrange Kalanı";
|
||||||
|
this.tabError.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabError.Padding = new Padding(6);
|
||||||
|
|
||||||
|
this.lblLagrangeTheory.Text = "📜 Lagrange Kalan Terimi: R_n(x) = f^(n+1)(ξ) / (n+1)! · (x - a)^(n+1) (Burada ξ, a ile x arasındadır)";
|
||||||
|
this.lblLagrangeTheory.Dock = DockStyle.Top;
|
||||||
|
this.lblLagrangeTheory.Height = 28;
|
||||||
|
this.lblLagrangeTheory.Font = new Font("Consolas", 9F, FontStyle.Bold);
|
||||||
|
this.lblLagrangeTheory.ForeColor = Color.FromArgb(56, 189, 248);
|
||||||
|
this.lblLagrangeTheory.TextAlign = ContentAlignment.MiddleLeft;
|
||||||
|
|
||||||
|
SetupGrid(this.dgvError);
|
||||||
|
this.tabError.Controls.Add(this.dgvError);
|
||||||
|
this.tabError.Controls.Add(this.lblLagrangeTheory);
|
||||||
|
|
||||||
|
// Tab 3: Detaylı Analitik Rapor
|
||||||
|
this.tabReport.Text = "Detaylı Rapor";
|
||||||
|
this.tabReport.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
this.tabReport.Padding = new Padding(6);
|
||||||
|
|
||||||
|
this.txtResult.Dock = DockStyle.Fill;
|
||||||
|
this.txtResult.BackColor = Color.FromArgb(11, 15, 28);
|
||||||
|
this.txtResult.BorderStyle = BorderStyle.None;
|
||||||
this.txtResult.ForeColor = Color.FromArgb(186, 230, 253);
|
this.txtResult.ForeColor = Color.FromArgb(186, 230, 253);
|
||||||
this.txtResult.Multiline = true;
|
this.txtResult.Multiline = true;
|
||||||
this.txtResult.ReadOnly = true;
|
this.txtResult.ReadOnly = true;
|
||||||
this.txtResult.ScrollBars = ScrollBars.Vertical;
|
this.txtResult.ScrollBars = ScrollBars.Vertical;
|
||||||
this.txtResult.Font = new Font("Consolas", 9.5F);
|
this.txtResult.Font = new Font("Consolas", 9.5F);
|
||||||
|
this.tabReport.Controls.Add(this.txtResult);
|
||||||
|
|
||||||
|
this.tabResults.TabPages.Add(this.tabTable);
|
||||||
|
this.tabResults.TabPages.Add(this.tabError);
|
||||||
|
this.tabResults.TabPages.Add(this.tabReport);
|
||||||
|
|
||||||
|
this.pnlContent.Controls.Add(this.splitVisual);
|
||||||
this.pnlContent.Controls.Add(this.pnlPresets);
|
this.pnlContent.Controls.Add(this.pnlPresets);
|
||||||
this.pnlContent.Controls.Add(this.pnlInputCard);
|
this.pnlContent.Controls.Add(this.pnlInputCard);
|
||||||
this.pnlContent.Controls.Add(this.pnlHeroPoly);
|
this.pnlContent.Controls.Add(this.pnlHeroPoly);
|
||||||
this.pnlContent.Controls.Add(this.lblResult);
|
|
||||||
this.pnlContent.Controls.Add(this.txtResult);
|
|
||||||
|
|
||||||
this.AutoScaleDimensions = new SizeF(7F, 15F);
|
this.AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = AutoScaleMode.Font;
|
this.AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
|
@ -188,25 +307,64 @@ namespace MathApp.Controls
|
||||||
this.Controls.Add(this.pnlContent);
|
this.Controls.Add(this.pnlContent);
|
||||||
this.Controls.Add(this.pnlHeader);
|
this.Controls.Add(this.pnlHeader);
|
||||||
this.Name = "TaylorSeriesControl";
|
this.Name = "TaylorSeriesControl";
|
||||||
this.Size = new Size(910, 680);
|
this.Size = new Size(920, 720);
|
||||||
|
|
||||||
this.pnlInputCard.ResumeLayout(false);
|
this.pnlInputCard.ResumeLayout(false);
|
||||||
this.pnlInputCard.PerformLayout();
|
this.pnlInputCard.PerformLayout();
|
||||||
|
this.pnlHeroButtons.ResumeLayout(false);
|
||||||
this.pnlHeroPoly.ResumeLayout(false);
|
this.pnlHeroPoly.ResumeLayout(false);
|
||||||
this.pnlHeroPoly.PerformLayout();
|
this.pnlHeroPoly.PerformLayout();
|
||||||
|
this.splitVisual.Panel1.ResumeLayout(false);
|
||||||
|
this.splitVisual.Panel2.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.splitVisual)).EndInit();
|
||||||
|
this.splitVisual.ResumeLayout(false);
|
||||||
|
this.tabTable.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgvTerms)).EndInit();
|
||||||
|
this.tabError.ResumeLayout(false);
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dgvError)).EndInit();
|
||||||
|
this.tabReport.ResumeLayout(false);
|
||||||
|
this.tabReport.PerformLayout();
|
||||||
|
this.tabResults.ResumeLayout(false);
|
||||||
this.pnlContent.ResumeLayout(false);
|
this.pnlContent.ResumeLayout(false);
|
||||||
this.pnlContent.PerformLayout();
|
|
||||||
((System.ComponentModel.ISupportInitialize)(this.numOrder)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.numOrder)).EndInit();
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetupGrid(DataGridView dgv)
|
||||||
|
{
|
||||||
|
dgv.Dock = DockStyle.Fill;
|
||||||
|
dgv.BackgroundColor = Color.FromArgb(15, 23, 42);
|
||||||
|
dgv.BorderStyle = BorderStyle.None;
|
||||||
|
dgv.EnableHeadersVisualStyles = false;
|
||||||
|
dgv.AllowUserToAddRows = false;
|
||||||
|
dgv.AllowUserToDeleteRows = false;
|
||||||
|
dgv.AllowUserToResizeRows = false;
|
||||||
|
dgv.RowHeadersVisible = false;
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(24, 33, 52);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.ForeColor = Color.FromArgb(148, 163, 184);
|
||||||
|
dgv.ColumnHeadersDefaultCellStyle.Font = new Font("Segoe UI Semibold", 8.5F, FontStyle.Bold);
|
||||||
|
dgv.ColumnHeadersHeight = 26;
|
||||||
|
dgv.DefaultCellStyle.BackColor = Color.FromArgb(20, 28, 48);
|
||||||
|
dgv.DefaultCellStyle.ForeColor = Color.White;
|
||||||
|
dgv.DefaultCellStyle.Font = new Font("Consolas", 9.5F);
|
||||||
|
dgv.DefaultCellStyle.SelectionBackColor = Color.FromArgb(37, 99, 235);
|
||||||
|
dgv.DefaultCellStyle.SelectionForeColor = Color.White;
|
||||||
|
dgv.GridColor = Color.FromArgb(40, 50, 75);
|
||||||
|
dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
|
||||||
|
dgv.ReadOnly = true;
|
||||||
|
}
|
||||||
|
|
||||||
private Panel pnlHeader;
|
private Panel pnlHeader;
|
||||||
private Panel pnlContent;
|
private Panel pnlContent;
|
||||||
private FlowLayoutPanel pnlPresets;
|
private FlowLayoutPanel pnlPresets;
|
||||||
private Label lblPresets;
|
private Label lblPresets;
|
||||||
private Button btnExSin;
|
private Button btnExSin;
|
||||||
|
private Button btnExCos;
|
||||||
private Button btnExExp;
|
private Button btnExExp;
|
||||||
private Button btnExLn;
|
private Button btnExLn;
|
||||||
|
private Button btnExGeom;
|
||||||
|
private Button btnExAtan;
|
||||||
|
|
||||||
private Panel pnlInputCard;
|
private Panel pnlInputCard;
|
||||||
private Label lblFunction;
|
private Label lblFunction;
|
||||||
|
|
@ -215,6 +373,7 @@ namespace MathApp.Controls
|
||||||
public TextBox txtVariable;
|
public TextBox txtVariable;
|
||||||
private Label lblCenterPoint;
|
private Label lblCenterPoint;
|
||||||
public TextBox txtCenterPoint;
|
public TextBox txtCenterPoint;
|
||||||
|
private Button btnMaclaurin;
|
||||||
private Label lblOrder;
|
private Label lblOrder;
|
||||||
public NumericUpDown numOrder;
|
public NumericUpDown numOrder;
|
||||||
public Button btnCalculate;
|
public Button btnCalculate;
|
||||||
|
|
@ -222,9 +381,31 @@ namespace MathApp.Controls
|
||||||
private Panel pnlHeroPoly;
|
private Panel pnlHeroPoly;
|
||||||
private Label lblHeroPolyTitle;
|
private Label lblHeroPolyTitle;
|
||||||
private Label lblHeroPolyValue;
|
private Label lblHeroPolyValue;
|
||||||
|
private FlowLayoutPanel pnlHeroButtons;
|
||||||
|
private Button btnNavToGraph;
|
||||||
private Button btnCopyPoly;
|
private Button btnCopyPoly;
|
||||||
|
private Button btnCopyLatex;
|
||||||
|
|
||||||
private Label lblResult;
|
private SplitContainer splitVisual;
|
||||||
|
private Panel pnlMiniCanvas;
|
||||||
|
private Label lblCanvasTitle;
|
||||||
|
|
||||||
|
private TabControl tabResults;
|
||||||
|
private TabPage tabTable;
|
||||||
|
private DataGridView dgvTerms;
|
||||||
|
private TabPage tabError;
|
||||||
|
private Label lblLagrangeTheory;
|
||||||
|
private DataGridView dgvError;
|
||||||
|
private TabPage tabReport;
|
||||||
public TextBox txtResult;
|
public TextBox txtResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class ControlExtensions
|
||||||
|
{
|
||||||
|
public static void DoubleBuffered(this Control control, bool enable)
|
||||||
|
{
|
||||||
|
var prop = typeof(Control).GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
|
||||||
|
prop?.SetValue(control, enable, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -10,14 +11,32 @@ namespace MathApp.Controls
|
||||||
{
|
{
|
||||||
public partial class TaylorSeriesControl : UserControl
|
public partial class TaylorSeriesControl : UserControl
|
||||||
{
|
{
|
||||||
|
private string _lastOriginalFn = "sin(x)";
|
||||||
|
private string _lastPolyEquation = "";
|
||||||
|
private decimal _lastCenter = 0m;
|
||||||
|
private decimal _lastF0 = 0m;
|
||||||
|
private List<(decimal Coeff, int Power)> _lastTerms = new List<(decimal, int)>();
|
||||||
|
private string _lastVariable = "x";
|
||||||
|
private bool _hasCalculated = false;
|
||||||
|
|
||||||
public TaylorSeriesControl()
|
public TaylorSeriesControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
InitializeGridColumns();
|
||||||
|
|
||||||
btnCalculate.Click += BtnCalculate_Click;
|
btnCalculate.Click += BtnCalculate_Click;
|
||||||
|
|
||||||
btnExSin.Click += (s, e) => LoadPreset("sin(x)", "x", "0", 5);
|
btnExSin.Click += (s, e) => LoadPreset("sin(x)", "x", "0", 5);
|
||||||
btnExExp.Click += (s, e) => LoadPreset("exp(x)", "x", "0", 4);
|
btnExCos.Click += (s, e) => LoadPreset("cos(x)", "x", "0", 6);
|
||||||
btnExLn.Click += (s, e) => LoadPreset("ln(x)", "x", "1", 4);
|
btnExExp.Click += (s, e) => LoadPreset("exp(x)", "x", "0", 5);
|
||||||
|
btnExLn.Click += (s, e) => LoadPreset("ln(1+x)", "x", "0", 4);
|
||||||
|
btnExGeom.Click += (s, e) => LoadPreset("1/(1-x)", "x", "0", 5);
|
||||||
|
btnExAtan.Click += (s, e) => LoadPreset("atan(x)", "x", "0", 5);
|
||||||
|
|
||||||
|
btnMaclaurin.Click += (s, e) => {
|
||||||
|
txtCenterPoint.Text = "0";
|
||||||
|
BtnCalculate_Click(this, EventArgs.Empty);
|
||||||
|
};
|
||||||
|
|
||||||
btnCopyPoly.Click += (s, e) => {
|
btnCopyPoly.Click += (s, e) => {
|
||||||
if (!string.IsNullOrEmpty(lblHeroPolyValue.Text) && lblHeroPolyValue.Text != "P_n(x) = —")
|
if (!string.IsNullOrEmpty(lblHeroPolyValue.Text) && lblHeroPolyValue.Text != "P_n(x) = —")
|
||||||
|
|
@ -27,9 +46,62 @@ namespace MathApp.Controls
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
btnCopyLatex.Click += (s, e) => {
|
||||||
|
if (!string.IsNullOrEmpty(_lastPolyEquation))
|
||||||
|
{
|
||||||
|
string latex = "P_{" + numOrder.Value + "}(" + _lastVariable + ") = " + _lastPolyEquation.Replace("*", " \\cdot ");
|
||||||
|
Clipboard.SetText(latex);
|
||||||
|
MessageBox.Show("Polinom LaTeX formatında panoya kopyalandı:\n\n" + latex, "LaTeX Kopyalandı", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
btnNavToGraph.Click += (s, e) => {
|
||||||
|
if (!string.IsNullOrWhiteSpace(_lastPolyEquation))
|
||||||
|
{
|
||||||
|
// Also send original function if desired, or send polynomial
|
||||||
|
MainForm.Instance?.NavigateToGraph(_lastPolyEquation, (float)_lastCenter, (float)_lastF0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Lütfen önce bir Taylor polinomu hesaplayınız.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
txtFunction.KeyDown += Input_KeyDown;
|
txtFunction.KeyDown += Input_KeyDown;
|
||||||
txtVariable.KeyDown += Input_KeyDown;
|
txtVariable.KeyDown += Input_KeyDown;
|
||||||
txtCenterPoint.KeyDown += Input_KeyDown;
|
txtCenterPoint.KeyDown += Input_KeyDown;
|
||||||
|
|
||||||
|
pnlMiniCanvas.Paint += PnlMiniCanvas_Paint;
|
||||||
|
pnlMiniCanvas.Resize += (s, e) => pnlMiniCanvas.Invalidate();
|
||||||
|
|
||||||
|
// Auto run first preset
|
||||||
|
LoadPreset("sin(x)", "x", "0", 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeGridColumns()
|
||||||
|
{
|
||||||
|
dgvTerms.Columns.Clear();
|
||||||
|
dgvTerms.Columns.Add("k", "k");
|
||||||
|
dgvTerms.Columns.Add("derivSym", "Mertebe f^(k)");
|
||||||
|
dgvTerms.Columns.Add("derivVal", "Noktadaki Değer f^(k)(a)");
|
||||||
|
dgvTerms.Columns.Add("fact", "k!");
|
||||||
|
dgvTerms.Columns.Add("coeffFrac", "Kesirli c_k");
|
||||||
|
dgvTerms.Columns.Add("coeffDec", "Ondalık c_k");
|
||||||
|
dgvTerms.Columns.Add("termStr", "Polinom Terimi");
|
||||||
|
|
||||||
|
dgvTerms.Columns["k"].Width = 35;
|
||||||
|
dgvTerms.Columns["derivSym"].Width = 85;
|
||||||
|
dgvTerms.Columns["derivVal"].Width = 110;
|
||||||
|
dgvTerms.Columns["fact"].Width = 60;
|
||||||
|
dgvTerms.Columns["coeffFrac"].Width = 100;
|
||||||
|
dgvTerms.Columns["coeffDec"].Width = 100;
|
||||||
|
|
||||||
|
dgvError.Columns.Clear();
|
||||||
|
dgvError.Columns.Add("testPoint", "Test Noktası (x)");
|
||||||
|
dgvError.Columns.Add("fVal", "Gerçek Değer f(x)");
|
||||||
|
dgvError.Columns.Add("polyVal", "Taylor P_n(x)");
|
||||||
|
dgvError.Columns.Add("absErr", "Mutlak Hata |f - P_n|");
|
||||||
|
dgvError.Columns.Add("relErr", "Bağıl Hata (%)");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Input_KeyDown(object sender, KeyEventArgs e)
|
private void Input_KeyDown(object sender, KeyEventArgs e)
|
||||||
|
|
@ -78,7 +150,7 @@ namespace MathApp.Controls
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var (polyFractional, polyFactorial, polyDecimal, derivLines) = await Task.Run(() =>
|
var calcData = await Task.Run(() =>
|
||||||
{
|
{
|
||||||
bool prevRad = Function.UseRadians;
|
bool prevRad = Function.UseRadians;
|
||||||
Function.UseRadians = true;
|
Function.UseRadians = true;
|
||||||
|
|
@ -86,6 +158,8 @@ namespace MathApp.Controls
|
||||||
List<string> fracTerms = new List<string>();
|
List<string> fracTerms = new List<string>();
|
||||||
List<string> factTerms = new List<string>();
|
List<string> factTerms = new List<string>();
|
||||||
List<string> decTerms = new List<string>();
|
List<string> decTerms = new List<string>();
|
||||||
|
List<(int k, string sym, string dVal, string fact, string fracC, string decC, string term)> termRows = new List<(int, string, string, string, string, string, string)>();
|
||||||
|
List<(decimal Coeff, int Power)> parsedTerms = new List<(decimal, int)>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -93,13 +167,17 @@ namespace MathApp.Controls
|
||||||
if (DecimalMath.Abs(f0) <= 0.00001m) f0 = 0m;
|
if (DecimalMath.Abs(f0) <= 0.00001m) f0 = 0m;
|
||||||
|
|
||||||
string f0Frac = NumericalMethods.FormatFractionalCoeff(f0);
|
string f0Frac = NumericalMethods.FormatFractionalCoeff(f0);
|
||||||
lines.Add($"[k = 0] f({center}) = {f0Frac} ({Math.Round(f0, 6).ToString("0.######", CultureInfo.InvariantCulture)})");
|
string f0Dec = Math.Round(f0, 6).ToString("0.######", CultureInfo.InvariantCulture);
|
||||||
|
lines.Add($"[k = 0] f({center}) = {f0Frac} ({f0Dec})");
|
||||||
|
|
||||||
|
termRows.Add((0, $"f({variable})", f0Dec, "1", f0Frac, f0Dec, f0 != 0m ? f0Frac : "0"));
|
||||||
|
parsedTerms.Add((f0, 0));
|
||||||
|
|
||||||
if (f0 != 0m)
|
if (f0 != 0m)
|
||||||
{
|
{
|
||||||
fracTerms.Add(f0Frac);
|
fracTerms.Add(f0Frac);
|
||||||
factTerms.Add(f0Frac);
|
factTerms.Add(f0Frac);
|
||||||
decTerms.Add(Math.Round(f0, 6).ToString("0.######", CultureInfo.InvariantCulture));
|
decTerms.Add(f0Dec);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int k = 1; k <= degree; k++)
|
for (int k = 1; k <= degree; k++)
|
||||||
|
|
@ -109,19 +187,26 @@ namespace MathApp.Controls
|
||||||
decimal fact = NumericalMethods.Factorial(k);
|
decimal fact = NumericalMethods.Factorial(k);
|
||||||
decimal coeff = dk / fact;
|
decimal coeff = dk / fact;
|
||||||
|
|
||||||
if (DecimalMath.Abs(coeff) <= 0.00001m)
|
|
||||||
{
|
|
||||||
lines.Add($"[k = {k}] f^({k})({center}) ≈ 0 => Katsayı = 0");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
string varPart;
|
string varPart;
|
||||||
if (center == 0m) varPart = k == 1 ? variable : $"{variable}^{k}";
|
if (center == 0m) varPart = k == 1 ? variable : $"{variable}^{k}";
|
||||||
else if (center > 0m) varPart = k == 1 ? $"({variable} - {center})" : $"({variable} - {center})^{k}";
|
else if (center > 0m) varPart = k == 1 ? $"({variable} - {center})" : $"({variable} - {center})^{k}";
|
||||||
else varPart = k == 1 ? $"({variable} + {DecimalMath.Abs(center)})" : $"({variable} + {DecimalMath.Abs(center)})^{k}";
|
else varPart = k == 1 ? $"({variable} + {DecimalMath.Abs(center)})" : $"({variable} + {DecimalMath.Abs(center)})^{k}";
|
||||||
|
|
||||||
// 1. Fractional Form (Simplified Fraction)
|
|
||||||
var frac = NumericalMethods.ToFraction(coeff);
|
var frac = NumericalMethods.ToFraction(coeff);
|
||||||
|
string coeffFracStr = frac.HasValue ? (frac.Value.Denom == 1 ? $"{frac.Value.Num}" : $"{frac.Value.Num}/{frac.Value.Denom}") : Math.Round(coeff, 6).ToString("0.######", CultureInfo.InvariantCulture);
|
||||||
|
string coeffDecStr = Math.Round(coeff, 6).ToString("0.######", CultureInfo.InvariantCulture);
|
||||||
|
string dValStr = Math.Round(dk, 5).ToString("0.#####", CultureInfo.InvariantCulture);
|
||||||
|
|
||||||
|
if (DecimalMath.Abs(coeff) <= 0.00001m)
|
||||||
|
{
|
||||||
|
lines.Add($"[k = {k}] f^({k})({center}) ≈ 0 => Katsayı = 0");
|
||||||
|
termRows.Add((k, $"f^({k})({variable})", dValStr, fact.ToString(CultureInfo.InvariantCulture), "0", "0", "0"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
parsedTerms.Add((coeff, k));
|
||||||
|
|
||||||
|
// 1. Fractional Form
|
||||||
string termFrac;
|
string termFrac;
|
||||||
if (frac.HasValue)
|
if (frac.HasValue)
|
||||||
{
|
{
|
||||||
|
|
@ -130,31 +215,27 @@ namespace MathApp.Controls
|
||||||
string sign = num < 0 ? (fracTerms.Count == 0 ? "-" : "- ") : (fracTerms.Count == 0 ? "" : "+ ");
|
string sign = num < 0 ? (fracTerms.Count == 0 ? "-" : "- ") : (fracTerms.Count == 0 ? "" : "+ ");
|
||||||
long absNum = Math.Abs(num);
|
long absNum = Math.Abs(num);
|
||||||
if (den == 1)
|
if (den == 1)
|
||||||
{
|
|
||||||
termFrac = absNum == 1 ? $"{sign}{varPart}" : $"{sign}{absNum}*{varPart}";
|
termFrac = absNum == 1 ? $"{sign}{varPart}" : $"{sign}{absNum}*{varPart}";
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
termFrac = absNum == 1 ? $"{sign}(1/{den})*{varPart}" : $"{sign}({absNum}/{den})*{varPart}";
|
termFrac = absNum == 1 ? $"{sign}(1/{den})*{varPart}" : $"{sign}({absNum}/{den})*{varPart}";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string sign = coeff < 0 ? (fracTerms.Count == 0 ? "-" : "- ") : (fracTerms.Count == 0 ? "" : "+ ");
|
string sign = coeff < 0 ? (fracTerms.Count == 0 ? "-" : "- ") : (fracTerms.Count == 0 ? "" : "+ ");
|
||||||
termFrac = $"{sign}{Math.Round(DecimalMath.Abs(coeff), 5).ToString("0.#####", CultureInfo.InvariantCulture)}*{varPart}";
|
termFrac = $"{sign}{Math.Round(DecimalMath.Abs(coeff), 5).ToString("0.#####", CultureInfo.InvariantCulture)}*{varPart}";
|
||||||
}
|
}
|
||||||
fracTerms.Add(termFrac);
|
fracTerms.Add(termFrac);
|
||||||
|
termRows.Add((k, $"f^({k})({variable})", dValStr, fact.ToString(CultureInfo.InvariantCulture), coeffFracStr, coeffDecStr, termFrac));
|
||||||
|
|
||||||
// 2. Factorial Form f^(k)(a) / k!
|
// 2. Factorial Form
|
||||||
var derFrac = NumericalMethods.ToFraction(dk);
|
var derFrac = NumericalMethods.ToFraction(dk);
|
||||||
string termFact;
|
|
||||||
string factSign = dk < 0 ? (factTerms.Count == 0 ? "-" : "- ") : (factTerms.Count == 0 ? "" : "+ ");
|
string factSign = dk < 0 ? (factTerms.Count == 0 ? "-" : "- ") : (factTerms.Count == 0 ? "" : "+ ");
|
||||||
decimal absDk = DecimalMath.Abs(dk);
|
decimal absDk = DecimalMath.Abs(dk);
|
||||||
|
string termFact;
|
||||||
if (derFrac.HasValue && derFrac.Value.Denom == 1)
|
if (derFrac.HasValue && derFrac.Value.Denom == 1)
|
||||||
{
|
{
|
||||||
long dVal = Math.Abs(derFrac.Value.Num);
|
long dVal = Math.Abs(derFrac.Value.Num);
|
||||||
if (dVal == 1) termFact = $"{factSign}(1/{k}!)*{varPart}";
|
termFact = dVal == 1 ? $"{factSign}(1/{k}!)*{varPart}" : $"{factSign}({dVal}/{k}!)*{varPart}";
|
||||||
else termFact = $"{factSign}({dVal}/{k}!)*{varPart}";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -165,18 +246,37 @@ namespace MathApp.Controls
|
||||||
|
|
||||||
// 3. Decimal Form
|
// 3. Decimal Form
|
||||||
string decSign = coeff < 0 ? (decTerms.Count == 0 ? "-" : "- ") : (decTerms.Count == 0 ? "" : "+ ");
|
string decSign = coeff < 0 ? (decTerms.Count == 0 ? "-" : "- ") : (decTerms.Count == 0 ? "" : "+ ");
|
||||||
string decStr = Math.Round(DecimalMath.Abs(coeff), 6).ToString("0.######", CultureInfo.InvariantCulture);
|
decTerms.Add($"{decSign}{coeffDecStr}*{varPart}");
|
||||||
decTerms.Add($"{decSign}{decStr}*{varPart}");
|
|
||||||
|
|
||||||
string coeffDisplay = frac.HasValue ? (frac.Value.Denom == 1 ? $"{frac.Value.Num}" : $"{frac.Value.Num}/{frac.Value.Denom}") : Math.Round(coeff, 6).ToString("0.######", CultureInfo.InvariantCulture);
|
lines.Add($"[k = {k,2}] f^({k})({center}) = {dValStr,-10} | {k}! = {fact,-8} => Kesirli: {coeffFracStr,-12} | Ondalık: {coeffDecStr}");
|
||||||
lines.Add($"[k = {k,2}] f^({k})({center}) = {Math.Round(dk, 5).ToString("0.#####", CultureInfo.InvariantCulture),-10} | {k}! = {fact,-8} => Kesirli: {coeffDisplay,-12} | Ondalık: {Math.Round(coeff, 6).ToString("0.######", CultureInfo.InvariantCulture)}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string finalFrac = fracTerms.Count == 0 ? "0" : string.Join(" ", fracTerms);
|
string finalFrac = fracTerms.Count == 0 ? "0" : string.Join(" ", fracTerms);
|
||||||
string finalFact = factTerms.Count == 0 ? "0" : string.Join(" ", factTerms);
|
string finalFact = factTerms.Count == 0 ? "0" : string.Join(" ", factTerms);
|
||||||
string finalDec = decTerms.Count == 0 ? "0" : string.Join(" ", decTerms);
|
string finalDec = decTerms.Count == 0 ? "0" : string.Join(" ", decTerms);
|
||||||
|
|
||||||
return (finalFrac, finalFact, finalDec, lines);
|
// Error evaluation at sample points around center
|
||||||
|
List<(decimal x, decimal fVal, decimal polyVal, decimal absErr, decimal relErr)> errRows = new List<(decimal, decimal, decimal, decimal, decimal)>();
|
||||||
|
decimal[] testDeltas = { -2m, -1m, -0.5m, -0.1m, 0.1m, 0.5m, 1m, 2m };
|
||||||
|
foreach (var d in testDeltas)
|
||||||
|
{
|
||||||
|
decimal tx = center + d;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
decimal realF = NumericalMethods.Method_EvaluateFunction(eq, variable, tx);
|
||||||
|
decimal polyF = 0m;
|
||||||
|
foreach (var t in parsedTerms)
|
||||||
|
{
|
||||||
|
polyF += t.Coeff * DecimalMath.Pow(tx - center, t.Power);
|
||||||
|
}
|
||||||
|
decimal absE = DecimalMath.Abs(realF - polyF);
|
||||||
|
decimal relE = DecimalMath.Abs(realF) > 1e-9m ? (absE / DecimalMath.Abs(realF)) * 100m : 0m;
|
||||||
|
errRows.Add((tx, realF, polyF, absE, relE));
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
return (finalFrac, finalFact, finalDec, lines, termRows, parsedTerms, errRows, f0);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -184,32 +284,62 @@ namespace MathApp.Controls
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
lblHeroPolyValue.Text = $"P_{degree}({variable}) = {polyFractional}";
|
_lastOriginalFn = eq;
|
||||||
|
_lastPolyEquation = calcData.finalFrac;
|
||||||
|
_lastCenter = center;
|
||||||
|
_lastF0 = calcData.f0;
|
||||||
|
_lastTerms = calcData.parsedTerms;
|
||||||
|
_lastVariable = variable;
|
||||||
|
_hasCalculated = true;
|
||||||
|
|
||||||
|
lblHeroPolyValue.Text = $"P_{degree}({variable}) = {calcData.finalFrac}";
|
||||||
lblHeroPolyValue.ForeColor = Color.FromArgb(52, 211, 153);
|
lblHeroPolyValue.ForeColor = Color.FromArgb(52, 211, 153);
|
||||||
|
|
||||||
|
// Populate dgvTerms
|
||||||
|
dgvTerms.Rows.Clear();
|
||||||
|
foreach (var r in calcData.termRows)
|
||||||
|
{
|
||||||
|
dgvTerms.Rows.Add(r.k, r.sym, r.dVal, r.fact, r.fracC, r.decC, r.term);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Populate dgvError
|
||||||
|
dgvError.Rows.Clear();
|
||||||
|
foreach (var er in calcData.errRows)
|
||||||
|
{
|
||||||
|
dgvError.Rows.Add(
|
||||||
|
Math.Round(er.x, 3).ToString(CultureInfo.InvariantCulture),
|
||||||
|
Math.Round(er.fVal, 6).ToString(CultureInfo.InvariantCulture),
|
||||||
|
Math.Round(er.polyVal, 6).ToString(CultureInfo.InvariantCulture),
|
||||||
|
Math.Round(er.absErr, 6).ToString(CultureInfo.InvariantCulture),
|
||||||
|
Math.Round(er.relErr, 3).ToString(CultureInfo.InvariantCulture) + "%"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.AppendLine($"=== {degree}. DERECEDEN TAYLOR POLİNOMU (Merkez a = {center}) ===");
|
sb.AppendLine($"=== {degree}. DERECEDEN TAYLOR POLİNOMU (Merkez a = {center}) ===");
|
||||||
sb.AppendLine($"Fonksiyon : f({variable}) = {eq}");
|
sb.AppendLine($"Fonksiyon : f({variable}) = {eq}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("📐 1) KESİRLİ SADELEŞTİRİLMİŞ FORM:");
|
sb.AppendLine("📐 1) KESİRLİ SADELEŞTİRİLMİŞ FORM:");
|
||||||
sb.AppendLine($" P_{degree}({variable}) = {polyFractional}");
|
sb.AppendLine($" P_{degree}({variable}) = {calcData.finalFrac}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("📜 2) ANALİTİK FAKTÖRİYELLİ FORM [ f^(k)(a)/k! ]:");
|
sb.AppendLine("📜 2) ANALİTİK FAKTÖRİYELLİ FORM [ f^(k)(a)/k! ]:");
|
||||||
sb.AppendLine($" P_{degree}({variable}) = {polyFactorial}");
|
sb.AppendLine($" P_{degree}({variable}) = {calcData.finalFact}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("🔢 3) ONDALIKLI SAYISAL YAKLAŞIM:");
|
sb.AppendLine("🔢 3) ONDALIKLI SAYISAL YAKLAŞIM:");
|
||||||
sb.AppendLine($" P_{degree}({variable}) = {polyDecimal}");
|
sb.AppendLine($" P_{degree}({variable}) = {calcData.finalDec}");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine(new string('=', 65));
|
sb.AppendLine(new string('=', 65));
|
||||||
sb.AppendLine("=== NOKTADAKİ TÜREVLER, FAKTÖRİYEL VE TERİM KATSAYILARI TABLOSU ===");
|
sb.AppendLine("=== NOKTADAKİ TÜREVLER, FAKTÖRİYEL VE TERİM KATSAYILARI TABLOSU ===");
|
||||||
sb.AppendLine(string.Join(Environment.NewLine, derivLines));
|
sb.AppendLine(string.Join(Environment.NewLine, calcData.lines));
|
||||||
|
|
||||||
txtResult.Text = sb.ToString();
|
txtResult.Text = sb.ToString();
|
||||||
|
|
||||||
|
pnlMiniCanvas.Invalidate();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
txtResult.Text = "❌ Hata: " + ex.Message;
|
txtResult.Text = "❌ Hata: " + ex.Message;
|
||||||
lblHeroPolyValue.Text = "Hata Oluştu";
|
lblHeroPolyValue.Text = "Hata Oluştu: " + ex.Message;
|
||||||
lblHeroPolyValue.ForeColor = Color.FromArgb(239, 68, 68);
|
lblHeroPolyValue.ForeColor = Color.FromArgb(239, 68, 68);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
@ -219,5 +349,162 @@ namespace MathApp.Controls
|
||||||
Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PnlMiniCanvas_Paint(object sender, PaintEventArgs e)
|
||||||
|
{
|
||||||
|
Graphics g = e.Graphics;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
|
int w = pnlMiniCanvas.Width;
|
||||||
|
int h = pnlMiniCanvas.Height;
|
||||||
|
if (w < 40 || h < 40) return;
|
||||||
|
|
||||||
|
g.Clear(Color.FromArgb(11, 15, 28));
|
||||||
|
|
||||||
|
if (!_hasCalculated || _lastTerms == null || _lastTerms.Count == 0)
|
||||||
|
{
|
||||||
|
using (Font f = new Font("Segoe UI", 9F))
|
||||||
|
using (Brush b = new SolidBrush(Color.FromArgb(100, 116, 139)))
|
||||||
|
{
|
||||||
|
g.DrawString("Hesaplama yapıldığında 2D yakınsama eğrisi burada gösterilir.", f, b, new RectangleF(10, 20, w - 20, 60));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Coordinate bounds around center point
|
||||||
|
decimal xSpan = 4m;
|
||||||
|
decimal xMin = _lastCenter - xSpan;
|
||||||
|
decimal xMax = _lastCenter + xSpan;
|
||||||
|
decimal yMin = -4m;
|
||||||
|
decimal yMax = 4m;
|
||||||
|
|
||||||
|
// Transform helpers
|
||||||
|
float ToScreenX(decimal x) => (float)((x - xMin) / (xMax - xMin) * (decimal)w);
|
||||||
|
float ToScreenY(decimal y) => (float)((yMax - y) / (yMax - yMin) * (decimal)h);
|
||||||
|
|
||||||
|
// Draw grid lines
|
||||||
|
using (Pen gridPen = new Pen(Color.FromArgb(24, 33, 52), 1f) { DashStyle = DashStyle.Dash })
|
||||||
|
{
|
||||||
|
for (decimal gx = Math.Floor(xMin); gx <= Math.Ceiling(xMax); gx += 1m)
|
||||||
|
{
|
||||||
|
float sx = ToScreenX(gx);
|
||||||
|
g.DrawLine(gridPen, sx, 0, sx, h);
|
||||||
|
}
|
||||||
|
for (decimal gy = Math.Floor(yMin); gy <= Math.Ceiling(yMax); gy += 1m)
|
||||||
|
{
|
||||||
|
float sy = ToScreenY(gy);
|
||||||
|
g.DrawLine(gridPen, 0, sy, w, sy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw primary axes
|
||||||
|
using (Pen axisPen = new Pen(Color.FromArgb(51, 65, 85), 1.5f))
|
||||||
|
{
|
||||||
|
float zeroX = ToScreenX(0m);
|
||||||
|
float zeroY = ToScreenY(0m);
|
||||||
|
if (zeroX >= 0 && zeroX <= w) g.DrawLine(axisPen, zeroX, 0, zeroX, h);
|
||||||
|
if (zeroY >= 0 && zeroY <= h) g.DrawLine(axisPen, 0, zeroY, w, zeroY);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dotted vertical line at center a
|
||||||
|
using (Pen centerLinePen = new Pen(Color.FromArgb(245, 158, 11), 1f) { DashStyle = DashStyle.Dot })
|
||||||
|
{
|
||||||
|
float cx = ToScreenX(_lastCenter);
|
||||||
|
g.DrawLine(centerLinePen, cx, 0, cx, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plot original function f(x) (Cyan)
|
||||||
|
List<PointF> fPoints = new List<PointF>();
|
||||||
|
List<PointF> pPoints = new List<PointF>();
|
||||||
|
int steps = Math.Max(80, w);
|
||||||
|
|
||||||
|
bool prevRad = Function.UseRadians;
|
||||||
|
Function.UseRadians = true;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for (int i = 0; i <= steps; i++)
|
||||||
|
{
|
||||||
|
decimal curX = xMin + ((decimal)i / steps) * (xMax - xMin);
|
||||||
|
|
||||||
|
// True f(x)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
decimal yVal = NumericalMethods.Method_EvaluateFunction(_lastOriginalFn, _lastVariable, curX);
|
||||||
|
if (DecimalMath.Abs(yVal) < 100m)
|
||||||
|
{
|
||||||
|
fPoints.Add(new PointF(ToScreenX(curX), ToScreenY(yVal)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
// Taylor P_n(x)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
decimal pVal = 0m;
|
||||||
|
foreach (var term in _lastTerms)
|
||||||
|
{
|
||||||
|
pVal += term.Coeff * DecimalMath.Pow(curX - _lastCenter, term.Power);
|
||||||
|
}
|
||||||
|
if (DecimalMath.Abs(pVal) < 100m)
|
||||||
|
{
|
||||||
|
pPoints.Add(new PointF(ToScreenX(curX), ToScreenY(pVal)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Function.UseRadians = prevRad;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw f(x) curve
|
||||||
|
if (fPoints.Count > 1)
|
||||||
|
{
|
||||||
|
using (Pen fPen = new Pen(Color.FromArgb(56, 189, 248), 2f))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < fPoints.Count - 1; i++)
|
||||||
|
{
|
||||||
|
if (Math.Abs(fPoints[i].Y - fPoints[i + 1].Y) < h * 0.8f)
|
||||||
|
g.DrawLine(fPen, fPoints[i], fPoints[i + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw Taylor curve
|
||||||
|
if (pPoints.Count > 1)
|
||||||
|
{
|
||||||
|
using (Pen pPen = new Pen(Color.FromArgb(16, 185, 129), 2f))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < pPoints.Count - 1; i++)
|
||||||
|
{
|
||||||
|
if (Math.Abs(pPoints[i].Y - pPoints[i + 1].Y) < h * 0.8f)
|
||||||
|
g.DrawLine(pPen, pPoints[i], pPoints[i + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw marked center point (a, f(a))
|
||||||
|
float ptX = ToScreenX(_lastCenter);
|
||||||
|
float ptY = ToScreenY(_lastF0);
|
||||||
|
if (ptX >= -10 && ptX <= w + 10 && ptY >= -10 && ptY <= h + 10)
|
||||||
|
{
|
||||||
|
using (Brush dotBrush = new SolidBrush(Color.FromArgb(245, 158, 11)))
|
||||||
|
{
|
||||||
|
g.FillEllipse(dotBrush, ptX - 4f, ptY - 4f, 8f, 8f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw Legend at top
|
||||||
|
using (Font f = new Font("Segoe UI", 7.5F))
|
||||||
|
using (Brush bCyan = new SolidBrush(Color.FromArgb(56, 189, 248)))
|
||||||
|
using (Brush bGreen = new SolidBrush(Color.FromArgb(16, 185, 129)))
|
||||||
|
using (Brush bAmber = new SolidBrush(Color.FromArgb(245, 158, 11)))
|
||||||
|
{
|
||||||
|
g.DrawString("— f(x)", f, bCyan, 8, 6);
|
||||||
|
g.DrawString("— P_n(x)", f, bGreen, 56, 6);
|
||||||
|
g.DrawString("● a", f, bAmber, 114, 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -405,7 +405,7 @@ public class NumericalMethods
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static decimal ComputeMixedPartialDerivative(
|
public static decimal ComputeMixedPartialDerivative(
|
||||||
Function f,
|
Function f,
|
||||||
List<string> varNames,
|
List<string> varNames,
|
||||||
int[] orders,
|
int[] orders,
|
||||||
|
|
|
||||||
2
src/ttCalculator/MainForm.Designer.cs
generated
2
src/ttCalculator/MainForm.Designer.cs
generated
|
|
@ -156,7 +156,7 @@ namespace MathApp
|
||||||
// Footer version label
|
// Footer version label
|
||||||
this.lblVersion.Dock = DockStyle.Bottom;
|
this.lblVersion.Dock = DockStyle.Bottom;
|
||||||
this.lblVersion.Height = 28;
|
this.lblVersion.Height = 28;
|
||||||
this.lblVersion.Text = "v3.4 • 128-bit Decimal Motoru • 60 FPS";
|
this.lblVersion.Text = "v3.5 • 128-bit Decimal Motoru • 60 FPS";
|
||||||
this.lblVersion.Font = new Font("Segoe UI", 8F);
|
this.lblVersion.Font = new Font("Segoe UI", 8F);
|
||||||
this.lblVersion.ForeColor = Color.FromArgb(100, 116, 139);
|
this.lblVersion.ForeColor = Color.FromArgb(100, 116, 139);
|
||||||
this.lblVersion.TextAlign = ContentAlignment.MiddleCenter;
|
this.lblVersion.TextAlign = ContentAlignment.MiddleCenter;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
<ApplicationIcon>logo.ico</ApplicationIcon>
|
<ApplicationIcon>logo.ico</ApplicationIcon>
|
||||||
<AssemblyName>ttCalculator</AssemblyName>
|
<AssemblyName>ttCalculator</AssemblyName>
|
||||||
<Product>ttCalculator - Gelişmiş Matematik & Nümerik Analiz Stüdyosu</Product>
|
<Product>ttCalculator - Gelişmiş Matematik & Nümerik Analiz Stüdyosu</Product>
|
||||||
<Version>3.4.0</Version>
|
<Version>3.5.0</Version>
|
||||||
<Company>ttCalculator</Company>
|
<Company>ttCalculator</Company>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace MathApp.Tests
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("=================================================");
|
Console.WriteLine("=================================================");
|
||||||
Console.WriteLine("ttCalculator v3.4 Numerical Studios Verification");
|
Console.WriteLine("ttCalculator v3.5 Numerical Studios Verification");
|
||||||
Console.WriteLine("=================================================");
|
Console.WriteLine("=================================================");
|
||||||
|
|
||||||
int passed = 0;
|
int passed = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue