Skip to content

Instantly share code, notes, and snippets.

View adammaj1's full-sized avatar

Adam adammaj1

View GitHub Profile
@mikehaertl
mikehaertl / gist:3258427
Created August 4, 2012 15:40
Learn you a Haskell - In a nutshell

Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.


1. Introduction

  • Haskell is a functional programming language.
/* *
* Copyright 1993-2012 NVIDIA Corporation. All rights reserved.
*
* Please refer to the NVIDIA end user license agreement (EULA) associated
* with this source code for terms and conditions that govern your use of
* this software. Any use, reproduction, disclosure, or distribution of
* this software and related documentation outside the terms of the EULA
* is strictly prohibited.
*/
#include <stdio.h>
/**
Author: Davide Spataro
email:[email protected]
www.davidespataro.it
*/
#define DOUBLE_PRECISION (1)
typedef double2 cl_double_complex;
typedef float2 cl_float_complex;
@dchoyle
dchoyle / FaaDiBrunoFromBellPolynomials.py
Created May 20, 2017 15:02
Python functions for iterative application of the Faa di Bruno formula
## Original author: David Hoyle ([email protected])
##
## Date: 2017-05-20
##
## Licence: CC-BY
from scipy.special import gammaln
import numpy as np
import math
import sympy
from __future__ import division, print_function, absolute_import
import numpy as np
import matplotlib.pyplot as plt
MAXITERS = 100
def mandelbrot_boettcher(z):
zn = z
@munrocket
munrocket / wgsl_2d_sdf.md
Last active September 13, 2024 06:29
WGSL 2D SDF Primitives

WGSL 2D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/398

Circle - exact

fn sdCircle(p: vec2f, r: f32) -> f32 {
  return length(p) - r;
}
// Compute the coefficients of the Jungreis function, i.e., the
// Fourier coefficients of the harmonic parametrization of the
// boundary of the Mandelbrot set, using the formulae given in
// following paper: John H. Ewing & Glenn Schober, "The area of the
// Mandelbrot set", Numer. Math. 61 (1992) 59-72 (esp. formulae (7)
// and (9)). (Note that their numerical values in table 1 give the
// coefficients of the inverse series.)
// The coefficients betatab[m+1][0] are the b_m such that
// z + sum(b_m*z^-m) defines a biholomorphic bijection from the
@Gro-Tsen
Gro-Tsen / ellipse-conformal-map.sage
Created December 15, 2022 16:34
Graphical representation of the Riemann mapping theorem for a square (inside and out) and an ellipse (inside and out)
# Square of eccentricity (but not that of the drawn ellipse):
modparm = 3/4
# The size of the drawn ellipse (semimajor and semiminor) is computed
# below.
### Mapping the inside of the disk to the inside of the ellipse:
prescale = N(modparm^(-1/4))
postscale = N(pi/(2*elliptic_kc(modparm)))