This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" pi from 10 * asin((phi-1)/2) | |
Uses Carlson's accelerated version of | |
Borchardt's modified AGM algorithm | |
Written by PM 2Ring 2022.05.11 | |
""" | |
from itertools import count | |
from decimal import Decimal as D, getcontext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Standard Solar Model (BP2004) | |
https://www.sns.ias.edu/~jnb/SNdata/Export/BP2004/bp2004stdmodel.dat | |
astro-ph/0402114 | |
Columns in the Standard Model table (below) represent: | |
1) Mass fraction in units of the solar mass | |
2) Radius of the zone in units of one solar radius | |
3) Temperature in units of deg (K) | |
4) Density in units of g/cm^3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Deterministic Miller-Rabin primality test | |
See https://en.m.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test | |
and https://miller-rabin.appspot.com/ | |
Written by PM 2Ring 2015.04.29 | |
Updated 2022.04.20 | |
""" | |
small_primes = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' Find all divisors in a range by sieving | |
Written by PM 2Ring 2017.05.03 | |
Prime GP version | |
''' | |
from itertools import product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Julian day number to date conversion | |
Proleptic Gregorian and Julian, with Astronomical years | |
i.e., 1 AD = year 1, 1 BC = year 0, 2 BC = year -1, etc | |
Derived from RG Tantzen (1963), ACM. | |
Algorithm 199: conversions between calendar date and Julian day number. | |
https://en.wikipedia.org/wiki/Julian_day | |
Julian day number 0 assigned to the day starting at noon on | |
January 1, 4713 BC, proleptic Julian calendar |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Retrieve data from Horizons using a batch-file | |
Written by PM 2Ring 2021.12.27 | |
""" | |
import re, requests | |
url = "https://ssd.jpl.nasa.gov/api/horizons_file.api" | |
pat = re.compile(r"(?:[^'\s]|'[^']*')+") | |
@interact | |
def go(batch=InputBox(width=40, height=24)): | |
if not batch: return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Multiplication Drill</title> | |
</head> | |
<body> | |
<h3>Multiplication Drill</h3> | |
<input id="aLo" type="number" value="2"><label for="aLo">Low A</label><br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch & parse leap-seconds.list | |
from datetime import datetime, timezone, timedelta | |
from hashlib import sha1 | |
import requests | |
# Leap second data source | |
# url = 'https://www.ietf.org/timezones/data/leap-seconds.list' | |
url = 'https://raw.githubusercontent.com/eggert/tz/main/leap-seconds.list' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.