Skip to content

Instantly share code, notes, and snippets.

View neozhaoliang's full-sized avatar

Zhao Liang neozhaoliang

View GitHub Profile
View hyperbolic_tiling.py
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simple Hyperbolic tiling animation using taichi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import taichi as ti
from taichi.math import *
ti.init(arch=ti.cpu)
@neozhaoliang
neozhaoliang / taichi_circle_packing.py
Last active October 6, 2023 08:01
Given an input image, convert it to a circle packing pattern
View taichi_circle_packing.py
import cv2
import cairocffi as cairo
import numpy as np
import taichi as ti
ti.init(arch=ti.cpu)
scale = 5
@neozhaoliang
neozhaoliang / return_probability.py
Created November 29, 2022 10:28
Random walk return probability
View return_probability.py
# pip install taichi
import taichi as ti
ti.init(arch=ti.gpu)
d = 3
num_rounds = 100000
max_steps = 1000000
ivec = ti.types.vector(d, int)
@neozhaoliang
neozhaoliang / fractal.py
Created November 28, 2022 13:29
cheatsheet 直播示例代码
View fractal.py
import taichi as ti
import taichi.math as tm
ti.init(arch=ti.vulkan)
w, h = 800, 640
res = (w, h)
pixels = ti.Vector.field(3, float, shape=res)
window = ti.ui.Window("fractal", res=res)
canvas = window.get_canvas()
@neozhaoliang
neozhaoliang / learn.md
Last active November 9, 2022 02:47
这周学了啥
View learn.md
  1. Riemann 映射定理
  2. Schwartz-Pick 引理
  3. Kolmogorov extension 定理
  4. 路径提升和同伦提升
  5. 用对偶锥的方法得出 Tits 锥的结构
  6. Witt 消去定理 (Peter Clark 的讲义)
  7. 理解了圆族是怎么来的,以及 mobius 变换的两个不动点对应的是光锥上的两个点。
  8. 理解了 Lorentz 群的一个连通分支 O^(3, 1) 为什么和 Mobius 群是通过的