Skip to content

Instantly share code, notes, and snippets.

@person142
person142 / organic_maps_tiles.py
Last active October 13, 2023 06:09
Organic maps tiles
import argparse
import json
import math
from pathlib import Path
from geopy.geocoders import Nominatim
from geopy.extra.rate_limiter import RateLimiter
CACHE_DIR = Path(__file__).parent / "cache"
@person142
person142 / test_halley_convergence.py
Last active March 1, 2018 16:02
Make sure Halley's method gets cubic convergence
import mpmath
from scipy.optimize import newton
import matplotlib.pyplot as plt
points = []
def f(x):
points.append(x)
return mpmath.sin(x)
@person142
person142 / lambertw_error.py
Created October 15, 2017 16:48
Explore the relative error in `scipy.special.lambertw`
from __future__ import division, print_function, absolute_import
from time import time
from multiprocessing import Pool
import mpmath
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.special as sc
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