예제 #1
0
// render renders a lissajous figure.
func render(w http.ResponseWriter, r *http.Request) {
	if err := r.ParseForm(); err != nil {
		http.Error(w, err.Error(), http.StatusBadRequest)
	}
	cycles, err := strconv.Atoi(r.FormValue("cycles"))
	if err != nil {
		cycles = 1
	}
	size, err := strconv.Atoi(r.FormValue("size"))
	if err != nil {
		size = 100
	}
	lissajous.Write(w, cycles, size)
}
예제 #2
0
// render renders a lissajous figure.
func render(w http.ResponseWriter, r *http.Request) {
	lissajous.Write(w)
}