From 40df98ae2f71ead616cff50def026eeefbea9aab Mon Sep 17 00:00:00 2001 From: Yongwei Xing Date: Fri, 26 Feb 2021 16:13:11 +0800 Subject: [PATCH] add comment --- wave.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wave.go b/wave.go index f1d69eb..e10640e 100644 --- a/wave.go +++ b/wave.go @@ -11,10 +11,12 @@ type wave struct { fn Formula } +// NewWave returns a wave generator. func NewWave(fn Formula) *wave { return &wave{fn: fn} } +// GenerativePolar draws the image in polar coordinator system. func (w *wave) GenerativePolar(c *canva, rgba color.RGBA) { for x := -math.Pi; x <= math.Pi; x += 0.01 { for y := -math.Pi; y <= math.Pi; y += 0.01 { @@ -28,6 +30,7 @@ func (w *wave) GenerativePolar(c *canva, rgba color.RGBA) { } } +// Generative draws the image in cartesian coordinator system. func (w *wave) Generative(c *canva, rgba color.RGBA) { for x := -math.Pi; x <= math.Pi; x += 0.008 { for y := -math.Pi; y <= math.Pi; y += 0.008 {