Example #1
0
func handlerLissa(w http.ResponseWriter, r *http.Request) {
	const fScale = 100.0
	freq := r.URL.Path[len("/lissa/"):]
	f := 0.0
	if freq == "" {
		f = rand.Float64() * 3.0
	} else {
		a, _ := strconv.ParseFloat(freq, 64)
		f = (a / fScale) * 3.0
	}
	lissa.Lissajous(w, f)
	log.Printf("Served Lissa w/ %g\n", f)
}
Example #2
0
func handler(w http.ResponseWriter, r *http.Request) {
	lissa.Lissajous(w)
}