1
0
mirror of https://github.com/osmarks/random-stuff synced 2024-11-08 13:39:53 +00:00
random-stuff/hyperplane.py

25 lines
559 B
Python
Raw Normal View History

2023-06-19 13:09:54 +00:00
def step(x):
return ((x * 1039) + (x * 6177) + 1605 + (x * 4253)) % 8041
points = set()
a, b, c = None, None, 417
for n in range(100000):
a, b, c = b, c, step(c)
if a is not None and b is not None:
points.add((a, b, c))
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = plt.axes(projection="3d")
def unzip(l):
ls = []
for x in l:
for i, v in enumerate(x):
if len(ls) <= i:
ls.append([])
ls[i].append(v)
return ls
ax.scatter(*unzip(points))
plt.show()