Welcome to graphwar-generator

this is a simple equation generator for graphwar, equations calculated using discrete cosine transformation graphwar

How this program works?

1. gather data from clicking using win32api

while True:
    a = win32api.GetKeyState(0x01)
    if int(win32api.GetAsyncKeyState(win32con.VK_RETURN)) != 0:
        break
    if a != state_left:  # state changed
        state_left = a
        if a < 0:
            rndtp = (round(win32gui.GetCursorPos()[0],20),round(win32gui.GetCursorPos()[1],20))#round up tuple
            rndtp2 = (round(transf(origin,top_right,rndtp)[0],3),round(transf(origin,top_right,rndtp)[1],3))
            listoftuples.append(rndtp2)
            print(win32gui.GetCursorPos())
    time.sleep(0.001)

2. generate interpolation of data using scipy

f_linear_interp = np.array([0])
f_linear_interp = interp1d(xdata,ydata)

Figure_1

3. generate samples and apply dct

f_linear_interp=np.array([0])
f_linear_interp = interp1d(xdata,ydata)#linear interpolation function

sample_num=50

x_sample=np.linspace(np.amin(xdata),np.amax(xdata),num=sample_num,endpoint=True) 
y_linear_sample=f_linear_interp(x_sample)
    
dct_result=scipy.fftpack.dct(y_linear_sample)

4. calculate equation using following formula

03ebd9c1833db5ff969647c08e457e6610c64ea5

equation_str = f"{(dct_result[0]/sample_num)/2:.10f}"
i=1
while i < sample_num:
    equation_str+=f"+{dct_result[i]/sample_num:.10f}*cos({i}pi((x-{np.amin(xdata)})*({sample_num}-1)/({np.amax(xdata)}-{np.amin(xdata)})+0.5)/{sample_num})"
    i+=1

more footage

螢幕擷取畫面 2022-07-23 024047 (2)

22

22321

123123

Github page

here

You can go to edleeebinj’s github to have fun.

Other

Whenever you are bored, GitHub Pages will rebuild the joy in your mind, from the ground up.

Mashed potato

Mashed potato is a lightweight and easy-to-use food. It includes nothing.

1+1=2!?

go check out my newest graphwar fft equation generator at my github page also check out https://edleebinj.github.io/graphwar-generator/

Despacito on 摩爾莊園