geometor / polynumbers

python modules and notebooks for analyzing polynomial series
https://geometor.github.io/polynumbers/
MIT License
3 stars 2 forks source link

integrate ghost curve functions #3

Open phiarchitect opened 2 years ago

phiarchitect commented 2 years ago

rotation and reflection plot functions from Federico:

Half rotation (180º) of $S_n(s)$: $x=s, y=1-S_n(s)$

def getHalfRotatedPoints(n, density): 
p = SpreadPoly(n) 
i = Fraction(1, density) 
k = Fraction(-1,density) 
x, y = [], []
for j in range(density+1):
k += i 
x.append(k)
y.append(1-PolyEval(p, k))
return x, y

Right rotation (90º left) of $S_n(s)$: $x = S_n(s), y=s$

def getRightRotatedPoints(n, density): 
    p = SpreadPoly(n) 
    i = Fraction(1, density) 
    k = Fraction(-1,density) 
    x, y = [], []
    for j in range(density+1):
        k += i 
        x.append(PolyEval(p, k))
        y.append(k)
    return x, y

Left rotation (90º right) of $S_n(s)$: $x = 1 - S_n(s), y=s$

def getLeftRotatedPoints(n, density): 
    p = SpreadPoly(n) 
    i = Fraction(1, density) 
    k = Fraction(-1,density) 
    x, y = [], []
    for j in range(density+1):
        k += i 
        x.append(1-PolyEval(p, k))
        y.append(k)
    return x, y

Originally posted by @rfede in https://github.com/geometor/polynumbers/discussions/1#discussioncomment-3057320