Skip to content

Instantly share code, notes, and snippets.

@ksenobojca
ksenobojca / astro.py
Created May 13, 2021 20:21
NASA asteroids in Blender 2.92
import bpy
import bmesh;
import random, math
import time
# Obsługa bardzo słabego formatu z NASA...
def split(line, breaks):
return [line[s:e-1].strip() for s, e in zip(breaks, breaks[1:])]
def extract_lines(path):
@ksenobojca
ksenobojca / fft.py
Last active October 14, 2022 06:04 — forked from berenoguz/fft.py
The Fast Fourier Transform and The Fast Polynomial Multiplication Algorithms in Python 3
from cmath import exp
from math import pi
# A simple class to simulate n-th root of unity
# This class is by no means complete and is implemented
# merely for FFT and FPM algorithms
class NthRootOfUnity:
def __init__(self, n, k = 1):
self.k = k
self.n = n