kececinumbers 0.2.3__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kececinumbers/__init__.py +1 -1
- kececinumbers/_version.py +1 -1
- kececinumbers/kececinumbers.py +263 -165
- {kececinumbers-0.2.3.dist-info → kececinumbers-0.3.1.dist-info}/METADATA +14 -4
- kececinumbers-0.3.1.dist-info/RECORD +8 -0
- kececinumbers-0.2.3.dist-info/RECORD +0 -8
- {kececinumbers-0.2.3.dist-info → kececinumbers-0.3.1.dist-info}/WHEEL +0 -0
- {kececinumbers-0.2.3.dist-info → kececinumbers-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {kececinumbers-0.2.3.dist-info → kececinumbers-0.3.1.dist-info}/top_level.txt +0 -0
kececinumbers/__init__.py
CHANGED
kececinumbers/_version.py
CHANGED
kececinumbers/kececinumbers.py
CHANGED
@@ -457,142 +457,6 @@ def _is_divisible(value, divisor, kececi_type):
|
|
457
457
|
return False
|
458
458
|
return False
|
459
459
|
|
460
|
-
# ==============================================================================
|
461
|
-
# --- CORE GENERATOR ---
|
462
|
-
# ==============================================================================
|
463
|
-
|
464
|
-
def unified_generator(kececi_type, start_input_raw, add_input_base_scalar, iterations):
|
465
|
-
"""
|
466
|
-
Herhangi bir desteklenen türde Keçeci Sayı dizileri üreten çekirdek motor.
|
467
|
-
Bu sürüm, tüm tipler için sağlam tür dönüştürme ve özel format ayrıştırma içerir.
|
468
|
-
"""
|
469
|
-
current_value = None
|
470
|
-
add_value_typed = None
|
471
|
-
ask_unit = None
|
472
|
-
use_integer_division = False
|
473
|
-
|
474
|
-
try:
|
475
|
-
# --- Adım 1: Keçeci Türüne Göre Başlatma ---
|
476
|
-
a_float = float(add_input_base_scalar)
|
477
|
-
|
478
|
-
if kececi_type in [TYPE_POSITIVE_REAL, TYPE_NEGATIVE_REAL]:
|
479
|
-
s_int = int(float(start_input_raw))
|
480
|
-
current_value = s_int
|
481
|
-
add_value_typed = int(a_float)
|
482
|
-
ask_unit = 1
|
483
|
-
use_integer_division = True
|
484
|
-
|
485
|
-
elif kececi_type == TYPE_FLOAT:
|
486
|
-
current_value = float(start_input_raw)
|
487
|
-
add_value_typed = a_float
|
488
|
-
ask_unit = 1.0
|
489
|
-
|
490
|
-
elif kececi_type == TYPE_RATIONAL:
|
491
|
-
current_value = Fraction(start_input_raw)
|
492
|
-
add_value_typed = Fraction(add_input_base_scalar)
|
493
|
-
ask_unit = Fraction(1)
|
494
|
-
|
495
|
-
elif kececi_type == TYPE_COMPLEX:
|
496
|
-
current_value = _parse_complex(start_input_raw)
|
497
|
-
add_value_typed = complex(a_float, a_float)
|
498
|
-
ask_unit = 1 + 1j
|
499
|
-
|
500
|
-
elif kececi_type == TYPE_NEUTROSOPHIC:
|
501
|
-
a, b = _parse_neutrosophic(start_input_raw)
|
502
|
-
current_value = NeutrosophicNumber(a, b)
|
503
|
-
add_value_typed = NeutrosophicNumber(a_float, 0)
|
504
|
-
ask_unit = NeutrosophicNumber(1, 1)
|
505
|
-
|
506
|
-
# --- YENİ EKLENEN/DÜZELTİLEN BLOKLAR ---
|
507
|
-
|
508
|
-
elif kececi_type == TYPE_NEUTROSOPHIC_COMPLEX: # HATA DÜZELTİLDİ
|
509
|
-
s_complex = _parse_complex(start_input_raw)
|
510
|
-
# Başlangıç indeterminacy değerini 0 olarak varsayalım
|
511
|
-
current_value = NeutrosophicComplexNumber(s_complex.real, s_complex.imag, 0.0)
|
512
|
-
# Artış, deterministik reel kısma etki eder
|
513
|
-
add_value_typed = NeutrosophicComplexNumber(a_float, 0.0, 0.0)
|
514
|
-
ask_unit = NeutrosophicComplexNumber(1, 1, 1)
|
515
|
-
|
516
|
-
elif kececi_type == TYPE_HYPERREAL: # HATA DÜZELTİLDİ
|
517
|
-
a, b = _parse_hyperreal(start_input_raw)
|
518
|
-
# 'a' reel kısmı, 'b' ise sonsuz küçükleri ölçekler
|
519
|
-
sequence_list = [a + b / n for n in range(1, 11)]
|
520
|
-
current_value = HyperrealNumber(sequence_list)
|
521
|
-
# Artış, sadece standart (ilk) reel kısma etki eder
|
522
|
-
add_sequence = [a_float] + [0.0] * 9
|
523
|
-
add_value_typed = HyperrealNumber(add_sequence)
|
524
|
-
ask_unit = HyperrealNumber([1.0] * 10)
|
525
|
-
|
526
|
-
elif kececi_type == TYPE_BICOMPLEX: # Mantık aynı, sadece ayrıştırıcıyı kullanıyor
|
527
|
-
s_complex = _parse_complex(start_input_raw)
|
528
|
-
a_complex = complex(a_float)
|
529
|
-
current_value = BicomplexNumber(s_complex, s_complex / 2)
|
530
|
-
add_value_typed = BicomplexNumber(a_complex, a_complex / 2)
|
531
|
-
ask_unit = BicomplexNumber(complex(1, 1), complex(0.5, 0.5))
|
532
|
-
|
533
|
-
elif kececi_type == TYPE_NEUTROSOPHIC_BICOMPLEX: # HATA DÜZELTİLDİ
|
534
|
-
s_complex = _parse_complex(start_input_raw)
|
535
|
-
# Başlangıç değeri olarak kompleks sayıyı kullanıp diğer 6 bileşeni 0 yapalım
|
536
|
-
current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0)
|
537
|
-
# Artış, sadece ana reel kısma etki eder
|
538
|
-
add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0)
|
539
|
-
ask_unit = NeutrosophicBicomplexNumber(*([1.0] * 8))
|
540
|
-
|
541
|
-
# --- DİĞER TİPLER ---
|
542
|
-
|
543
|
-
elif kececi_type == TYPE_QUATERNION:
|
544
|
-
s_float = float(start_input_raw)
|
545
|
-
current_value = np.quaternion(s_float, s_float, s_float, s_float)
|
546
|
-
add_value_typed = np.quaternion(a_float, a_float, a_float, a_float)
|
547
|
-
ask_unit = np.quaternion(1, 1, 1, 1)
|
548
|
-
|
549
|
-
else:
|
550
|
-
raise ValueError(f"Geçersiz veya desteklenmeyen Keçeci Sayı Tipi: {kececi_type}")
|
551
|
-
|
552
|
-
except (ValueError, TypeError) as e:
|
553
|
-
print(f"HATA: Tip {kececi_type} için '{start_input_raw}' girdisiyle başlatma başarısız: {e}")
|
554
|
-
return []
|
555
|
-
|
556
|
-
# --- Adım 2: İterasyon Döngüsü ---
|
557
|
-
sequence = [current_value]
|
558
|
-
last_divisor_used = None
|
559
|
-
ask_counter = 0
|
560
|
-
|
561
|
-
for _ in range(iterations):
|
562
|
-
added_value = current_value + add_value_typed
|
563
|
-
sequence.append(added_value)
|
564
|
-
|
565
|
-
result_value = added_value
|
566
|
-
divided_successfully = False
|
567
|
-
|
568
|
-
primary_divisor = 3 if last_divisor_used == 2 or last_divisor_used is None else 2
|
569
|
-
alternative_divisor = 2 if primary_divisor == 3 else 3
|
570
|
-
|
571
|
-
for divisor in [primary_divisor, alternative_divisor]:
|
572
|
-
if _is_divisible(added_value, divisor, kececi_type):
|
573
|
-
result_value = added_value // divisor if use_integer_division else added_value / divisor
|
574
|
-
last_divisor_used = divisor
|
575
|
-
divided_successfully = True
|
576
|
-
break
|
577
|
-
|
578
|
-
if not divided_successfully and is_prime(added_value):
|
579
|
-
modified_value = (added_value + ask_unit) if ask_counter == 0 else (added_value - ask_unit)
|
580
|
-
ask_counter = 1 - ask_counter
|
581
|
-
sequence.append(modified_value)
|
582
|
-
|
583
|
-
result_value = modified_value
|
584
|
-
|
585
|
-
for divisor in [primary_divisor, alternative_divisor]:
|
586
|
-
if _is_divisible(modified_value, divisor, kececi_type):
|
587
|
-
result_value = modified_value // divisor if use_integer_division else modified_value / divisor
|
588
|
-
last_divisor_used = divisor
|
589
|
-
break
|
590
|
-
|
591
|
-
sequence.append(result_value)
|
592
|
-
current_value = result_value
|
593
|
-
|
594
|
-
return sequence
|
595
|
-
|
596
460
|
def _parse_complex(s: str) -> complex:
|
597
461
|
"""
|
598
462
|
Bir string'i kompleks sayıya çevirir.
|
@@ -700,6 +564,58 @@ def _parse_hyperreal(s: str) -> (float, float):
|
|
700
564
|
|
701
565
|
return a, b
|
702
566
|
|
567
|
+
def _parse_quaternion(s: str) -> np.quaternion:
|
568
|
+
"""
|
569
|
+
Kullanıcıdan gelen metin girdisini ('a+bi+cj+dk' veya sadece skaler)
|
570
|
+
bir kuaterniyon nesnesine çevirir.
|
571
|
+
|
572
|
+
Örnekler:
|
573
|
+
- '2.5' -> quaternion(2.5, 2.5, 2.5, 2.5)
|
574
|
+
- '2.5+2.5i+2.5j+2.5k' -> quaternion(2.5, 2.5, 2.5, 2.5)
|
575
|
+
- '1-2i+3.5j-k' -> quaternion(1, -2, 3.5, -1)
|
576
|
+
"""
|
577
|
+
s_clean = s.replace(" ", "").lower()
|
578
|
+
if not s_clean:
|
579
|
+
raise ValueError("Girdi boş olamaz.")
|
580
|
+
|
581
|
+
# Girdinin sadece bir sayı olup olmadığını kontrol et
|
582
|
+
try:
|
583
|
+
val = float(s_clean)
|
584
|
+
# Programın orijinal mantığına göre skalerden kuaterniyon oluştur
|
585
|
+
return np.quaternion(val, val, val, val)
|
586
|
+
except ValueError:
|
587
|
+
# Girdi tam bir kuaterniyon ifadesi, ayrıştırmaya devam et
|
588
|
+
pass
|
589
|
+
|
590
|
+
# Tüm kuaterniyon bileşenlerini bulmak için daha esnek bir regex
|
591
|
+
# Örnek: '-10.5j', '+2i', '5', '-k' gibi parçaları yakalar
|
592
|
+
pattern = re.compile(r'([+-]?\d*\.?\d+)([ijk])?')
|
593
|
+
matches = pattern.findall(s_clean.replace('i', 'i ').replace('j', 'j ').replace('k', 'k ')) # Ayrıştırmayı kolaylaştır
|
594
|
+
|
595
|
+
parts = {'w': 0.0, 'x': 0.0, 'y': 0.0, 'z': 0.0}
|
596
|
+
|
597
|
+
# 'i', 'j', 'k' olmayan katsayıları ('-1k' gibi) düzeltmek için
|
598
|
+
s_temp = s_clean
|
599
|
+
for val_str, comp in re.findall(r'([+-])([ijk])', s_clean):
|
600
|
+
s_temp = s_temp.replace(val_str+comp, f'{val_str}1{comp}')
|
601
|
+
|
602
|
+
matches = pattern.findall(s_temp)
|
603
|
+
|
604
|
+
if not matches:
|
605
|
+
raise ValueError(f"Geçersiz kuaterniyon formatı: '{s}'")
|
606
|
+
|
607
|
+
for value_str, component in matches:
|
608
|
+
value = float(value_str)
|
609
|
+
if component == 'i':
|
610
|
+
parts['x'] += value
|
611
|
+
elif component == 'j':
|
612
|
+
parts['y'] += value
|
613
|
+
elif component == 'k':
|
614
|
+
parts['z'] += value
|
615
|
+
else: # Reel kısım
|
616
|
+
parts['w'] += value
|
617
|
+
|
618
|
+
return np.quaternion(parts['w'], parts['x'], parts['y'], parts['z'])
|
703
619
|
|
704
620
|
def get_random_type(num_iterations, fixed_start_raw="0", fixed_add_base_scalar=9.0):
|
705
621
|
"""
|
@@ -730,6 +646,146 @@ def get_random_type(num_iterations, fixed_start_raw="0", fixed_add_base_scalar=9
|
|
730
646
|
|
731
647
|
return generated_sequence
|
732
648
|
|
649
|
+
# ==============================================================================
|
650
|
+
# --- CORE GENERATOR ---
|
651
|
+
# ==============================================================================
|
652
|
+
|
653
|
+
def unified_generator(kececi_type, start_input_raw, add_input_base_scalar, iterations):
|
654
|
+
"""
|
655
|
+
Herhangi bir desteklenen türde Keçeci Sayı dizileri üreten çekirdek motor.
|
656
|
+
Bu sürüm, tüm tipler için sağlam tür dönüştürme ve özel format ayrıştırma içerir.
|
657
|
+
"""
|
658
|
+
current_value = None
|
659
|
+
add_value_typed = None
|
660
|
+
ask_unit = None
|
661
|
+
use_integer_division = False
|
662
|
+
|
663
|
+
try:
|
664
|
+
# --- Adım 1: Keçeci Türüne Göre Başlatma ---
|
665
|
+
a_float = float(add_input_base_scalar)
|
666
|
+
|
667
|
+
if kececi_type in [TYPE_POSITIVE_REAL, TYPE_NEGATIVE_REAL]:
|
668
|
+
s_int = int(float(start_input_raw))
|
669
|
+
current_value = s_int
|
670
|
+
add_value_typed = int(a_float)
|
671
|
+
ask_unit = 1
|
672
|
+
use_integer_division = True
|
673
|
+
|
674
|
+
elif kececi_type == TYPE_FLOAT:
|
675
|
+
current_value = float(start_input_raw)
|
676
|
+
add_value_typed = a_float
|
677
|
+
ask_unit = 1.0
|
678
|
+
|
679
|
+
elif kececi_type == TYPE_RATIONAL:
|
680
|
+
current_value = Fraction(start_input_raw)
|
681
|
+
add_value_typed = Fraction(add_input_base_scalar)
|
682
|
+
ask_unit = Fraction(1)
|
683
|
+
|
684
|
+
elif kececi_type == TYPE_COMPLEX:
|
685
|
+
current_value = _parse_complex(start_input_raw)
|
686
|
+
add_value_typed = complex(a_float, a_float)
|
687
|
+
ask_unit = 1 + 1j
|
688
|
+
|
689
|
+
elif kececi_type == TYPE_NEUTROSOPHIC:
|
690
|
+
a, b = _parse_neutrosophic(start_input_raw)
|
691
|
+
current_value = NeutrosophicNumber(a, b)
|
692
|
+
add_value_typed = NeutrosophicNumber(a_float, 0)
|
693
|
+
ask_unit = NeutrosophicNumber(1, 1)
|
694
|
+
|
695
|
+
# --- YENİ EKLENEN/DÜZELTİLEN BLOKLAR ---
|
696
|
+
|
697
|
+
elif kececi_type == TYPE_NEUTROSOPHIC_COMPLEX: # HATA DÜZELTİLDİ
|
698
|
+
s_complex = _parse_complex(start_input_raw)
|
699
|
+
# Başlangıç indeterminacy değerini 0 olarak varsayalım
|
700
|
+
current_value = NeutrosophicComplexNumber(s_complex.real, s_complex.imag, 0.0)
|
701
|
+
# Artış, deterministik reel kısma etki eder
|
702
|
+
add_value_typed = NeutrosophicComplexNumber(a_float, 0.0, 0.0)
|
703
|
+
ask_unit = NeutrosophicComplexNumber(1, 1, 1)
|
704
|
+
|
705
|
+
elif kececi_type == TYPE_HYPERREAL: # HATA DÜZELTİLDİ
|
706
|
+
a, b = _parse_hyperreal(start_input_raw)
|
707
|
+
# 'a' reel kısmı, 'b' ise sonsuz küçükleri ölçekler
|
708
|
+
sequence_list = [a + b / n for n in range(1, 11)]
|
709
|
+
current_value = HyperrealNumber(sequence_list)
|
710
|
+
# Artış, sadece standart (ilk) reel kısma etki eder
|
711
|
+
add_sequence = [a_float] + [0.0] * 9
|
712
|
+
add_value_typed = HyperrealNumber(add_sequence)
|
713
|
+
ask_unit = HyperrealNumber([1.0] * 10)
|
714
|
+
|
715
|
+
elif kececi_type == TYPE_BICOMPLEX: # Mantık aynı, sadece ayrıştırıcıyı kullanıyor
|
716
|
+
s_complex = _parse_complex(start_input_raw)
|
717
|
+
a_complex = complex(a_float)
|
718
|
+
current_value = BicomplexNumber(s_complex, s_complex / 2)
|
719
|
+
add_value_typed = BicomplexNumber(a_complex, a_complex / 2)
|
720
|
+
ask_unit = BicomplexNumber(complex(1, 1), complex(0.5, 0.5))
|
721
|
+
|
722
|
+
elif kececi_type == TYPE_NEUTROSOPHIC_BICOMPLEX: # HATA DÜZELTİLDİ
|
723
|
+
s_complex = _parse_complex(start_input_raw)
|
724
|
+
# Başlangıç değeri olarak kompleks sayıyı kullanıp diğer 6 bileşeni 0 yapalım
|
725
|
+
current_value = NeutrosophicBicomplexNumber(s_complex.real, s_complex.imag, 0, 0, 0, 0, 0, 0)
|
726
|
+
# Artış, sadece ana reel kısma etki eder
|
727
|
+
add_value_typed = NeutrosophicBicomplexNumber(a_float, 0, 0, 0, 0, 0, 0, 0)
|
728
|
+
ask_unit = NeutrosophicBicomplexNumber(*([1.0] * 8))
|
729
|
+
|
730
|
+
# --- DİĞER TİPLER ---
|
731
|
+
|
732
|
+
elif kececi_type == TYPE_QUATERNION:
|
733
|
+
# Artık girdiyi doğrudan float'a çevirmek yerine,
|
734
|
+
# hem skaler hem de tam ifadeyi ayrıştırabilen fonksiyonu kullanıyoruz.
|
735
|
+
current_value = _parse_quaternion(start_input_raw)
|
736
|
+
|
737
|
+
# Artırım değeri (add_value) genellikle basit bir skalerdir,
|
738
|
+
# bu yüzden bu kısım aynı kalabilir.
|
739
|
+
add_value_typed = np.quaternion(a_float, a_float, a_float, a_float)
|
740
|
+
ask_unit = np.quaternion(1, 1, 1, 1)
|
741
|
+
|
742
|
+
else:
|
743
|
+
raise ValueError(f"Geçersiz veya desteklenmeyen Keçeci Sayı Tipi: {kececi_type}")
|
744
|
+
|
745
|
+
except (ValueError, TypeError) as e:
|
746
|
+
print(f"HATA: Tip {kececi_type} için '{start_input_raw}' girdisiyle başlatma başarısız: {e}")
|
747
|
+
return []
|
748
|
+
|
749
|
+
# --- Adım 2: İterasyon Döngüsü ---
|
750
|
+
sequence = [current_value]
|
751
|
+
last_divisor_used = None
|
752
|
+
ask_counter = 0
|
753
|
+
|
754
|
+
for _ in range(iterations):
|
755
|
+
added_value = current_value + add_value_typed
|
756
|
+
sequence.append(added_value)
|
757
|
+
|
758
|
+
result_value = added_value
|
759
|
+
divided_successfully = False
|
760
|
+
|
761
|
+
primary_divisor = 3 if last_divisor_used == 2 or last_divisor_used is None else 2
|
762
|
+
alternative_divisor = 2 if primary_divisor == 3 else 3
|
763
|
+
|
764
|
+
for divisor in [primary_divisor, alternative_divisor]:
|
765
|
+
if _is_divisible(added_value, divisor, kececi_type):
|
766
|
+
result_value = added_value // divisor if use_integer_division else added_value / divisor
|
767
|
+
last_divisor_used = divisor
|
768
|
+
divided_successfully = True
|
769
|
+
break
|
770
|
+
|
771
|
+
if not divided_successfully and is_prime(added_value):
|
772
|
+
modified_value = (added_value + ask_unit) if ask_counter == 0 else (added_value - ask_unit)
|
773
|
+
ask_counter = 1 - ask_counter
|
774
|
+
sequence.append(modified_value)
|
775
|
+
|
776
|
+
result_value = modified_value
|
777
|
+
|
778
|
+
for divisor in [primary_divisor, alternative_divisor]:
|
779
|
+
if _is_divisible(modified_value, divisor, kececi_type):
|
780
|
+
result_value = modified_value // divisor if use_integer_division else modified_value / divisor
|
781
|
+
last_divisor_used = divisor
|
782
|
+
break
|
783
|
+
|
784
|
+
sequence.append(result_value)
|
785
|
+
current_value = result_value
|
786
|
+
|
787
|
+
return sequence
|
788
|
+
|
733
789
|
def print_detailed_report(sequence, params):
|
734
790
|
"""
|
735
791
|
Generates and prints a detailed report of the Keçeci sequence results.
|
@@ -922,8 +978,8 @@ def find_kececi_prime_number(kececi_numbers_list):
|
|
922
978
|
|
923
979
|
def plot_numbers(sequence, title="Keçeci Number Sequence Analysis"):
|
924
980
|
"""
|
925
|
-
Plots the generated Keçeci Number sequence with appropriate
|
926
|
-
for each number type.
|
981
|
+
Plots the generated Keçeci Number sequence with appropriate, detailed
|
982
|
+
visualizations for each number type.
|
927
983
|
"""
|
928
984
|
plt.style.use('seaborn-v0_8-whitegrid')
|
929
985
|
|
@@ -931,25 +987,19 @@ def plot_numbers(sequence, title="Keçeci Number Sequence Analysis"):
|
|
931
987
|
print("Sequence is empty, nothing to plot.")
|
932
988
|
return
|
933
989
|
|
934
|
-
fig = plt.figure(figsize=(
|
990
|
+
fig = plt.figure(figsize=(16, 9)) # Daha geniş bir görünüm için boyut ayarlandı
|
935
991
|
plt.suptitle(title, fontsize=16, y=0.98)
|
936
992
|
first_elem = sequence[0]
|
937
993
|
|
938
|
-
# ---
|
994
|
+
# --- Her Türe Özel Çizim Mantığı ---
|
939
995
|
|
940
|
-
|
941
|
-
# This correctly handles types 1, 2, and 4 (Positive/Negative Real, Float).
|
942
|
-
if isinstance(first_elem, (int, float)):
|
996
|
+
if isinstance(first_elem, (int, float, Fraction)):
|
943
997
|
ax = fig.add_subplot(1, 1, 1)
|
944
|
-
ax.plot([float(x) for x in sequence], 'o-')
|
998
|
+
ax.plot([float(x) for x in sequence], 'o-', label="Value")
|
945
999
|
ax.set_title("Value over Iterations")
|
946
|
-
ax.set_xlabel("Index")
|
947
|
-
|
948
|
-
|
949
|
-
ax = fig.add_subplot(1, 1, 1)
|
950
|
-
ax.plot([float(x) for x in sequence], 'o-')
|
951
|
-
ax.set_title("Value over Iterations (as float)")
|
952
|
-
ax.set_xlabel("Index"); ax.set_ylabel("Value")
|
1000
|
+
ax.set_xlabel("Index")
|
1001
|
+
ax.set_ylabel("Value")
|
1002
|
+
ax.legend()
|
953
1003
|
|
954
1004
|
elif isinstance(first_elem, complex):
|
955
1005
|
gs = GridSpec(2, 2, figure=fig)
|
@@ -974,17 +1024,18 @@ def plot_numbers(sequence, title="Keçeci Number Sequence Analysis"):
|
|
974
1024
|
elif isinstance(first_elem, np.quaternion):
|
975
1025
|
gs = GridSpec(2, 1, figure=fig)
|
976
1026
|
ax1 = fig.add_subplot(gs[0, 0])
|
977
|
-
ax2 = fig.add_subplot(gs[1, 0])
|
1027
|
+
ax2 = fig.add_subplot(gs[1, 0], sharex=ax1) # X eksenini paylaş
|
978
1028
|
|
979
1029
|
ax1.plot([q.w for q in sequence], 'o-', label='w (scalar)')
|
980
1030
|
ax1.plot([q.x for q in sequence], 's--', label='x')
|
981
1031
|
ax1.plot([q.y for q in sequence], '^--', label='y')
|
982
1032
|
ax1.plot([q.z for q in sequence], 'd--', label='z')
|
983
|
-
ax1.set_title("Quaternion Components"); ax1.legend()
|
1033
|
+
ax1.set_title("Quaternion Components over Iterations"); ax1.legend()
|
984
1034
|
|
985
1035
|
magnitudes = [np.sqrt(q.w**2 + q.x**2 + q.y**2 + q.z**2) for q in sequence]
|
986
1036
|
ax2.plot(magnitudes, 'o-', color='purple', label='Magnitude')
|
987
|
-
ax2.set_title("Quaternion Magnitude"); ax2.legend()
|
1037
|
+
ax2.set_title("Quaternion Magnitude over Iterations"); ax2.legend()
|
1038
|
+
ax2.set_xlabel("Index")
|
988
1039
|
|
989
1040
|
elif isinstance(first_elem, BicomplexNumber):
|
990
1041
|
gs = GridSpec(2, 2, figure=fig)
|
@@ -1000,8 +1051,8 @@ def plot_numbers(sequence, title="Keçeci Number Sequence Analysis"):
|
|
1000
1051
|
ax2.plot(z2r, label='z2.real'); ax2.plot(z2i, label='z2.imag')
|
1001
1052
|
ax2.set_title("Component z2"); ax2.legend()
|
1002
1053
|
|
1003
|
-
ax3.plot(z1r, z1i, '.-'); ax3.set_title("z1
|
1004
|
-
ax4.plot(z2r, z2i, '.-'); ax4.set_title("z2
|
1054
|
+
ax3.plot(z1r, z1i, '.-'); ax3.set_title("z1 Trajectory"); ax3.set_xlabel("Real"); ax3.set_ylabel("Imaginary")
|
1055
|
+
ax4.plot(z2r, z2i, '.-'); ax4.set_title("z2 Trajectory"); ax4.set_xlabel("Real"); ax4.set_ylabel("Imaginary")
|
1005
1056
|
|
1006
1057
|
elif isinstance(first_elem, NeutrosophicNumber):
|
1007
1058
|
gs = GridSpec(1, 2, figure=fig)
|
@@ -1009,25 +1060,72 @@ def plot_numbers(sequence, title="Keçeci Number Sequence Analysis"):
|
|
1009
1060
|
|
1010
1061
|
a = [x.a for x in sequence]; b = [x.b for x in sequence]
|
1011
1062
|
ax1.plot(a, label='Determinate (a)'); ax1.plot(b, label='Indeterminate (b)')
|
1012
|
-
ax1.set_title("Components"); ax1.legend()
|
1063
|
+
ax1.set_title("Components over Iterations"); ax1.legend()
|
1013
1064
|
|
1014
1065
|
sc = ax2.scatter(a, b, c=range(len(a)), cmap='viridis')
|
1015
|
-
ax2.set_title("Determinate
|
1066
|
+
ax2.set_title("Trajectory (colored by time)"); ax2.set_xlabel("Determinate Part"); ax2.set_ylabel("Indeterminate Part"); fig.colorbar(sc, ax=ax2, label="Iteration")
|
1016
1067
|
|
1017
1068
|
elif isinstance(first_elem, NeutrosophicComplexNumber):
|
1018
|
-
gs = GridSpec(
|
1019
|
-
ax1 = fig.add_subplot(gs[0, 0]); ax2 = fig.add_subplot(gs[
|
1069
|
+
gs = GridSpec(2, 1, figure=fig)
|
1070
|
+
ax1 = fig.add_subplot(gs[0, 0]); ax2 = fig.add_subplot(gs[1, 0])
|
1020
1071
|
|
1021
1072
|
r = [x.real for x in sequence]; i = [x.imag for x in sequence]; ind = [x.indeterminacy for x in sequence]
|
1022
1073
|
ax1.plot(r, label='Real'); ax1.plot(i, label='Imag'); ax1.plot(ind, label='Indeterminacy', linestyle=':')
|
1023
|
-
ax1.set_title("Components"); ax1.legend()
|
1074
|
+
ax1.set_title("Components over Iterations"); ax1.legend()
|
1024
1075
|
|
1025
|
-
sc = ax2.scatter(r, i, c=ind, cmap='magma')
|
1026
|
-
ax2.set_title("Complex Plane (colored by Indeterminacy)");
|
1076
|
+
sc = ax2.scatter(r, i, c=ind, cmap='magma', s=20)
|
1077
|
+
ax2.set_title("Trajectory in Complex Plane (colored by Indeterminacy)");
|
1078
|
+
ax2.set_xlabel("Real Part"); ax2.set_ylabel("Imaginary Part");
|
1079
|
+
fig.colorbar(sc, ax=ax2, label='Indeterminacy')
|
1080
|
+
ax2.axis('equal')
|
1081
|
+
|
1082
|
+
# --- YENİ EKLENEN BLOKLAR ---
|
1027
1083
|
|
1028
|
-
|
1084
|
+
elif isinstance(first_elem, HyperrealNumber):
|
1085
|
+
gs = GridSpec(2, 1, figure=fig)
|
1086
|
+
ax1 = fig.add_subplot(gs[0, 0])
|
1087
|
+
ax2 = fig.add_subplot(gs[1, 0])
|
1088
|
+
|
1089
|
+
# İlk birkaç bileşeni çiz
|
1090
|
+
num_components_to_plot = min(len(first_elem.sequence), 4)
|
1091
|
+
for i in range(num_components_to_plot):
|
1092
|
+
comp_data = [h.sequence[i] for h in sequence]
|
1093
|
+
ax1.plot(comp_data, label=f'Component {i}')
|
1094
|
+
ax1.set_title("Hyperreal Components over Iterations"); ax1.legend()
|
1095
|
+
|
1096
|
+
# En önemli iki bileşenin yörüngesini çiz
|
1097
|
+
comp0 = [h.sequence[0] for h in sequence]
|
1098
|
+
comp1 = [h.sequence[1] for h in sequence]
|
1099
|
+
sc = ax2.scatter(comp0, comp1, c=range(len(comp0)), cmap='plasma')
|
1100
|
+
ax2.set_title("Trajectory in Standard-Infinitesimal Plane (C0 vs C1)")
|
1101
|
+
ax2.set_xlabel("Standard Part (C0)"); ax2.set_ylabel("Primary Infinitesimal (C1)")
|
1102
|
+
fig.colorbar(sc, ax=ax2, label="Iteration")
|
1103
|
+
|
1104
|
+
elif isinstance(first_elem, NeutrosophicBicomplexNumber):
|
1105
|
+
gs = GridSpec(2, 2, figure=fig)
|
1106
|
+
ax1 = fig.add_subplot(gs[0, 0]); ax2 = fig.add_subplot(gs[0, 1])
|
1107
|
+
ax3 = fig.add_subplot(gs[1, 0]); ax4 = fig.add_subplot(gs[1, 1])
|
1108
|
+
|
1109
|
+
# Ana 4 yörüngeyi çizelim
|
1110
|
+
r = [n.real for n in sequence]; i = [n.imag for n in sequence]
|
1111
|
+
ax1.plot(r, i, '.-', label='(1, i1)')
|
1112
|
+
ax1.set_title("Primary Deterministic Plane"); ax1.legend()
|
1113
|
+
|
1114
|
+
nr = [n.neut_real for n in sequence]; ni = [n.neut_imag for n in sequence]
|
1115
|
+
ax2.plot(nr, ni, '.-', label='(I, I*i1)')
|
1116
|
+
ax2.set_title("Primary Neutrosophic Plane"); ax2.legend()
|
1117
|
+
|
1118
|
+
jr = [n.j_real for n in sequence]; ji = [n.j_imag for n in sequence]
|
1119
|
+
ax3.plot(jr, ji, '.-', label='(i2, i1*i2)')
|
1120
|
+
ax3.set_title("Secondary Deterministic Plane"); ax3.legend()
|
1121
|
+
|
1122
|
+
njr = [n.j_neut_real for n in sequence]; nji = [n.j_neut_imag for n in sequence]
|
1123
|
+
ax4.plot(njr, nji, '.-', label='(I*i2, I*i1*i2)')
|
1124
|
+
ax4.set_title("Secondary Neutrosophic Plane"); ax4.legend()
|
1125
|
+
|
1126
|
+
else: # Gelecekte eklenebilecek diğer tipler için yedek blok
|
1029
1127
|
ax = fig.add_subplot(1, 1, 1)
|
1030
|
-
ax.text(0.5, 0.5, f"Plotting for type '{type(first_elem).__name__}'
|
1128
|
+
ax.text(0.5, 0.5, f"Plotting for type '{type(first_elem).__name__}' is not specifically implemented.",
|
1031
1129
|
ha='center', va='center', fontsize=12, bbox=dict(facecolor='lightyellow'))
|
1032
1130
|
|
1033
1131
|
plt.tight_layout(rect=[0, 0, 1, 0.96])
|
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: kececinumbers
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.1
|
4
4
|
Summary: Keçeci Numbers: An Exploration of a Dynamic Sequence Across Diverse Number Sets
|
5
5
|
Home-page: https://github.com/WhiteSymmetry/kececinumbers
|
6
6
|
Author: Mehmet Keçeci
|
7
|
-
Author-email:
|
7
|
+
Author-email: mkececi@yaani.com
|
8
8
|
Maintainer: Mehmet Keçeci
|
9
|
-
Maintainer-email:
|
9
|
+
Maintainer-email: mkececi@yaani.com
|
10
10
|
License: MIT
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
@@ -218,7 +218,17 @@ Keçeci Number Types:
|
|
218
218
|
|
219
219
|
6: Quaternions (scalar start input becomes q(s,s,s,s): e.g., 1 or 2.5)
|
220
220
|
|
221
|
-
|
221
|
+
7: Neutrosophic
|
222
|
+
|
223
|
+
8: Neutro-Complex
|
224
|
+
|
225
|
+
9: Hyperreal
|
226
|
+
|
227
|
+
10: Bicomplex
|
228
|
+
|
229
|
+
11: Neutro-Bicomplex
|
230
|
+
|
231
|
+
Please select Keçeci Number Type (1-11): 1
|
222
232
|
|
223
233
|
Enter the starting number (e.g., 0 or 2.5, complex:3+4j, rational: 3/4, quaternions: 1) : 0
|
224
234
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
kececinumbers/__init__.py,sha256=LvYVIpFwtVQFC96CoVl_6Dl-wGDq5Z_wdYNM9xEOm_o,1427
|
2
|
+
kececinumbers/_version.py,sha256=5Me7OC9f5i_J_SZL1X16-PL4uJBlBEVYbEQzP10j62Y,428
|
3
|
+
kececinumbers/kececinumbers.py,sha256=yoYthgKqEx4h4Mk3vAcKuc5bQ9R6nQqcPK7fBT8FXfY,48675
|
4
|
+
kececinumbers-0.3.1.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
5
|
+
kececinumbers-0.3.1.dist-info/METADATA,sha256=jOkFLfHvc2MUC8re9-YaiV9w1jp3iI02lwdFB9wDM1o,15499
|
6
|
+
kececinumbers-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
kececinumbers-0.3.1.dist-info/top_level.txt,sha256=VvlbQKmTjOlzBbvq54-AaXp_WPRZ5dOhw91lV-ytPRQ,14
|
8
|
+
kececinumbers-0.3.1.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
kececinumbers/__init__.py,sha256=WIyxRjeIKuHHrzqcqiU38Topi2gyLCeaOe_uMJvXv_0,1427
|
2
|
-
kececinumbers/_version.py,sha256=JEAyNI1JmKj3piUdMG7qoVLaD_5sllx8xnucwQfbMI8,428
|
3
|
-
kececinumbers/kececinumbers.py,sha256=D7bwhI8vJRC8HU07t5mkl9rPXDfOcyD2GROISnIn9Vo,44279
|
4
|
-
kececinumbers-0.2.3.dist-info/licenses/LICENSE,sha256=NJZsJEbQuKzxn1mWPWCbRx8jRUqGS22thl8wwuRQJ9c,1071
|
5
|
-
kececinumbers-0.2.3.dist-info/METADATA,sha256=j7BXyx-MVh61JeHk0yf4hL6QjNm1-rgHqyNqwGgWJ4k,15398
|
6
|
-
kececinumbers-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
-
kececinumbers-0.2.3.dist-info/top_level.txt,sha256=VvlbQKmTjOlzBbvq54-AaXp_WPRZ5dOhw91lV-ytPRQ,14
|
8
|
-
kececinumbers-0.2.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|