Skip to content

Instantly share code, notes, and snippets.

@Centrinia
Centrinia / 🍎🍌🍍.txt
Created May 23, 2023 20:54
🍎/(🍌+🍍)+🍌/(🍎+🍍)+🍍/(🍎+🍌)=16
🍎 = 424649495769301218670115896459280655963725125378350669851735671891032826780692452657763181843206178859214536292179514888965989693114253999130097942123331813966770766536299370785439827658273493547118740126273206730961144031793602538465985462875667803879216890007366023233940806931613241003494839084413654612158657919669568791073390304931480991974908528091509289846379120709880420205012295644898241586200817084181130862205852937480632512745350976415229818370903255611475140764457856382302572405944165308253033733662539931162082139744737163984640627134780804796643565624507592776796959491142060765314447038005083850520685958297185807123336730920195763106248849891815602862696686668767224344451728971853253294163114452045718341124905578925548682325720214958709162078176170516108809595672642751591913759517852539669437394137591593263203060350211423242834315569844195445085194412155317239394750285891450600779576684755417587916503533276917212209899772397928536652189052934456285843710203664574140672374307858808686385581211496
@Centrinia
Centrinia / normals.csv
Last active January 21, 2022 07:40
x y z w where x^2+y^2+z^2-w^2=0
0 0 1 1
0 6271941 1626100 6479309
-21449596 -51329565 -76947300 94951021
323261792 -254271628 19108651 411724893
89022 44110 -145455 176147
-19054074 -15444910 4276593 24897635
-36086400 30422840 -25060641 53439809
-15908332 25999116 25123779 39499789
-63721506 -41010949 30122358 81545599
-193544564 -550723736 498268633 767481441
diff --git a/Quake/gl_rmain.c b/Quake/gl_rmain.c
index 7095aa3..b36cc34 100644
--- a/Quake/gl_rmain.c
+++ b/Quake/gl_rmain.c
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// r_main.c
#include "quakedef.h"
+#define YSHEAR 1
R.<a,b,c> = PolynomialRing(QQ, 3)
R2.<x> = PolynomialRing(QQ)
pol = a / (b + c) + b / (c + a) + c / (a + b) - 4
pol *= pol.denominator()
F = R(pol)
def find_initial(F):
1/2 = 2^-1 * 1
1/3 = 2^0 * (0 + (1)_2/(2^2-1))
1/4 = 2^-2 * 1
1/5 = 2^0 * (0 + (1, 1)_2/(2^4-1))
1/6 = 2^-1 * (0 + (1)_2/(2^2-1))
1/7 = 2^0 * (0 + (1)_2/(2^3-1))
1/8 = 2^-3 * 1
1/9 = 2^0 * (0 + (1, 1, 1)_2/(2^6-1))
1/10 = 2^-1 * (0 + (1, 1)_2/(2^4-1))
/* bit_fiddling.cc */
#include <iostream>
/* Rotate the bits of x to the right by I bits. */
template <typename T>
inline T rotate_right(const T & x, const int & I)
{
const int N = sizeof(T) * 8;
const int reduced_I = I % N;
@Centrinia
Centrinia / README.md
Created January 25, 2020 19:39
Mandelbrot Orbit Differences
#define T double
kernel void barycentric_interpolator(
global const T* xp,
global T* yp,
int count,
global const T* xs,
global const T* ws,
global const T* ys
) {
int gid = get_global_id(0);
def main():
import argparse
parser = argparse.ArgumentParser(description='Generate Pascal\'s Triangle')
parser.add_argument('out', help='output file')
parser.add_argument('--width', '-w', default=1024, help='image width in pixels', type=int)
parser.add_argument('--modulus', '-m', help='modulus', type=int)
parser.add_argument('--isosceles', action='store_true', help='render isosceles triangle')
parser.add_argument('--verbose', '-v', action='count', default=0)
import numpy as np
def stern_sequence(n):
import numpy as np
a = np.array([0, 1], dtype=np.int64)
for _ in range(1, n):
a = np.vstack((a, np.roll(a, -1) + a)).reshape((-1,), order='F')
a[-1] += 1