Skip to content

Instantly share code, notes, and snippets.

View soniakeys's full-sized avatar

Sonia Keys soniakeys

View GitHub Profile
@soniakeys
soniakeys / pre.go
Created July 14, 2017 19:47
for Wolfgang
package main
import (
"fmt"
"log"
"math"
"github.com/soniakeys/meeus/base"
"github.com/soniakeys/meeus/coord"
pp "github.com/soniakeys/meeus/planetposition"

Keybase proof

I hereby claim:

  • I am soniakeys on github.
  • I am sonia (https://keybase.io/sonia) on keybase.
  • I have a public key ASBxpRCxAlK7NX867UGuXunxyU5lhq3bfkt0RQofTbcGwwo

To claim this, I am signing this object:

package main
import (
"fmt"
"log"
"math"
"math/rand"
"os"
"testing"
"time"
@soniakeys
soniakeys / dur.go
Created June 19, 2015 12:59
ISO 8601 Durations
const (
decPart = `\d*[.,]\d*`
intPart = `\d+`
decS = `(?:(?P<decS>` + decPart + `)S)`
intS = `(?:(?P<intS>` + intPart + `)S)?`
sPat = `(?:` + decS + `|` + intS + `)`
decMin = `(?:(?P<decMin>` + decPart + `)M)`
intMin = `(?:(?P<intMin>` + intPart + `)M)?`
@soniakeys
soniakeys / output
Last active March 22, 2018 19:31
Meeus sunrise, sunset example
Sunrise: 6ʰ45ᵐ28ˢ
Sunset: 17ʰ11ᵐ46ˢ
@soniakeys
soniakeys / chi2.go
Created April 21, 2012 00:55
incomplete gamma, chi square, uniform distribution
package chi2
import "math"
func Chi2p(dof int, distance float64) float64 {
return IncGammaQ(.5*float64(dof), .5*distance)
}
func IncGammaQ(a, x float64) float64 {
if x < a+1 {