cmtritt 0.1.0__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.
- cmtritt/__init__.py +45 -0
- cmtritt-0.1.0.dist-info/METADATA +24 -0
- cmtritt-0.1.0.dist-info/RECORD +4 -0
- cmtritt-0.1.0.dist-info/WHEEL +4 -0
cmtritt/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import math
|
|
3
|
+
from cycler import cycler
|
|
4
|
+
|
|
5
|
+
_ex = np.array([-1, -1, 2], dtype=float)
|
|
6
|
+
_ey = np.array([1, -1, 0], dtype=float)
|
|
7
|
+
_ez = np.array([1, 1, 1], dtype=float)
|
|
8
|
+
_ex /= np.linalg.norm(_ex)
|
|
9
|
+
_ey /= np.linalg.norm(_ey)
|
|
10
|
+
_ez /= np.linalg.norm(_ez)
|
|
11
|
+
|
|
12
|
+
_phi = (1 + math.sqrt(5))/2
|
|
13
|
+
_psi = (1 - math.sqrt(5))/2
|
|
14
|
+
_r2 = math.sqrt(2)
|
|
15
|
+
_r3 = math.sqrt(3)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class fn:
|
|
19
|
+
@staticmethod
|
|
20
|
+
def golden(index: int):
|
|
21
|
+
theta_0 = 0.6
|
|
22
|
+
theta_2_0 = 0.9
|
|
23
|
+
theta = (-index + 3)*_phi + theta_0
|
|
24
|
+
theta_2 = ((index/7 + 3)*(_psi) + theta_2_0)
|
|
25
|
+
|
|
26
|
+
colour_t = 0.5*np.cos(math.tau*theta)*_ex + 0.5*np.sin(math.tau*theta)*_ey
|
|
27
|
+
# colour = 0.5*_r3*_ez + 0.5/_r2*(np.cos(math.tau*theta_2)**2)*_ez + 0.5*(np.sin(math.tau*theta_2)**2)*colour_t
|
|
28
|
+
# colour = 0.5*_r3*_ez + colour_t
|
|
29
|
+
colour = 0.4*_r3*_ez + 0.15*_r3*(np.sin(math.tau*theta_2))*_ez + 0.5*colour_t*(0.5 + np.cos(math.tau*theta_2)**2)
|
|
30
|
+
# colour *= 0.8
|
|
31
|
+
colour = list(colour)
|
|
32
|
+
# print(colour)
|
|
33
|
+
|
|
34
|
+
return colour
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class cy:
|
|
38
|
+
golden = cycler(color=[fn.golden(index) for index in range(25)])
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class apply:
|
|
42
|
+
@staticmethod
|
|
43
|
+
def golden():
|
|
44
|
+
import matplotlib as mpl
|
|
45
|
+
mpl.rcParams["axes.prop_cycle"] = cy.golden
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: cmtritt
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Author: Alexander Tritt Monash
|
|
6
|
+
Author-email: Alexander Tritt Monash <alex.tritt@monash.edu>
|
|
7
|
+
Requires-Dist: numpy>=2.5.4
|
|
8
|
+
Requires-Python: >=3.14
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# Tritt colour cycles
|
|
12
|
+
|
|
13
|
+
## Golden
|
|
14
|
+
|
|
15
|
+
Colours are separated in hue by an angle of the golden ratio.
|
|
16
|
+
This means that colours stay well separated when a new colour is added.
|
|
17
|
+
|
|
18
|
+
To apply `matplotlib`:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
import cmtritt
|
|
22
|
+
|
|
23
|
+
cmtritt.apply.golden()
|
|
24
|
+
```
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
cmtritt/__init__.py,sha256=XcSFYBd1gZ_sgv7DVMOt7-M6mdnQvcat99kQlObEGZU,1241
|
|
2
|
+
cmtritt-0.1.0.dist-info/WHEEL,sha256=Kot-FOXwz2no6rGIg4et79Z7m6vcKPAXr2Y6fTFpZuI,81
|
|
3
|
+
cmtritt-0.1.0.dist-info/METADATA,sha256=vf2pdtcSWHGGU88Y3VHXF8YAvFO98hiqFZnKfUpCHIE,511
|
|
4
|
+
cmtritt-0.1.0.dist-info/RECORD,,
|