```python
from sympy import *
```


```python
import matplotlib.pyplot
matplotlib.pyplot.rcParams['figure.figsize'] = 5, 5
```


```python
h, l = symbols("h l")
```


```python
# Average elementary hue angles
R = 0
Y = 67
G = 140
C = 180
B = 239
M = 303

k_r = (0.299*0.2126)**0.5
k_g = (0.587*0.7152)**0.5
k_b = (0.114*0.0722)**0.5

# Delta hue
d_RY = Y - R
d_YG = G - Y
d_GC = C - G
d_CB = B - C
d_BM = M - B
d_MR = 360 - M

# Luminosity
R_L = k_r
Y_L = k_r + k_g - 0.2
G_L = k_g - 0.1
C_L = k_g + k_b - 0.1
B_L = k_b
M_L = k_b + k_r

# Slope
s_RY = (Y_L - R_L)/d_RY
s_YG = (G_L - Y_L)/d_YG
s_GC = (C_L - G_L)/d_GC
s_CB = (B_L - C_L)/d_CB
s_BM = (M_L - B_L)/d_BM
s_MR = (R_L - M_L)/d_MR

plot(
    (-(-R*s_RY + R_L + h*s_RY - 0.5), (h, R, Y)),
    (-(-Y*s_YG + Y_L + h*s_YG - 0.5), (h, Y, G)),
    (-(-G*s_GC + G_L + h*s_GC - 0.5), (h, G, C)),
    (-(-C*s_CB + C_L + h*s_CB - 0.5), (h, C, B)),
    (-(-B*s_BM + B_L + h*s_BM - 0.5), (h, B, M)),
    (-(-M*s_MR + M_L + h*s_MR - 0.5), (h, M, 360)),
    (0.5, (h, 0, 360)),
    axis_center=(0, 0),
);
```


```python
[R_L, Y_L, G_L, C_L, B_L, M_L]
```




    [0.25212576226954675,
     0.7000627962473862,
     0.5479370339778395,
     0.6386607905138207,
     0.09072375653598125,
     0.342849518805528]




```python
R, Y, G, C, B, M, d_RY, d_YG, d_GC, d_CB, d_BM, d_MR, R_L, Y_L, G_L, C_L, B_L, M_L, s_RY, s_YG, s_GC, s_CB, s_BM, s_MR = \
    symbols("R Y G C B M d_RY d_YG d_GC d_CB d_BM d_MR R_L Y_L G_L C_L B_L M_L s_RY s_YG s_GC s_CB s_BM s_MR")
```


```python
[
-(-R*s_RY + R_L + h*s_RY - 0.5),
-(-Y*s_YG + Y_L + h*s_YG - 0.5),
-(-G*s_GC + G_L + h*s_GC - 0.5),
-(-C*s_CB + C_L + h*s_CB - 0.5),
-(-B*s_BM + B_L + h*s_BM - 0.5),
-(-M*s_MR + M_L + h*s_MR - 0.5),
]
```




    [R*s_RY - R_L - h*s_RY + 0.5,
     Y*s_YG - Y_L - h*s_YG + 0.5,
     G*s_GC - G_L - h*s_GC + 0.5,
     C*s_CB - C_L - h*s_CB + 0.5,
     B*s_BM - B_L - h*s_BM + 0.5,
     M*s_MR - M_L - h*s_MR + 0.5]




```python
plot((x, (x, 0, 0.5)),
     (1 - x, (x, 0.5, 1)),
     xlim=(-2, 2), ylim=(-2, 2),
     axiscenter=(0.0));
```


```python
x, y = symbols("x y")
```


```python
plot(-(2*x - 1)**2/2 + 1/2, xlim=(-2, 2), ylim=(-2, 2), axiscenter=(0.0));
```


```python
(-(2*x - 1)**2 + 1)/2
```




    -(2*x - 1)**2/2 + 1/2




```python
plot(2*x**2,
     2*(x - 1)**2,
     xlim=(-2, 2), ylim=(-2, 2), axiscenter=(0.0));
```


```python

```

a362cb68b0aa7c9296d265f30b482ae93c1667b6
ipynb
Jupyter Notebook
formulas.ipynb
AlanCristhian/colorwheel
a7ca7c558f5eacafbb1687057eb238c990f9cbe1
MIT
2022-02-02T16:08:19.000Z
2022-02-02T16:08:19.000Z
formulas.ipynb
AlanCristhian/colorwheel
a7ca7c558f5eacafbb1687057eb238c990f9cbe1
MIT
formulas.ipynb
AlanCristhian/colorwheel
a7ca7c558f5eacafbb1687057eb238c990f9cbe1
MIT
Qwen/Qwen-72B
1. YES
2. YES