add comment
This commit is contained in:
parent
85796c1348
commit
40df98ae2f
1 changed files with 3 additions and 0 deletions
3
wave.go
3
wave.go
|
@ -11,10 +11,12 @@ type wave struct {
|
||||||
fn Formula
|
fn Formula
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewWave returns a wave generator.
|
||||||
func NewWave(fn Formula) *wave {
|
func NewWave(fn Formula) *wave {
|
||||||
return &wave{fn: fn}
|
return &wave{fn: fn}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GenerativePolar draws the image in polar coordinator system.
|
||||||
func (w *wave) GenerativePolar(c *canva, rgba color.RGBA) {
|
func (w *wave) GenerativePolar(c *canva, rgba color.RGBA) {
|
||||||
for x := -math.Pi; x <= math.Pi; x += 0.01 {
|
for x := -math.Pi; x <= math.Pi; x += 0.01 {
|
||||||
for y := -math.Pi; y <= math.Pi; y += 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) {
|
func (w *wave) Generative(c *canva, rgba color.RGBA) {
|
||||||
for x := -math.Pi; x <= math.Pi; x += 0.008 {
|
for x := -math.Pi; x <= math.Pi; x += 0.008 {
|
||||||
for y := -math.Pi; y <= math.Pi; y += 0.008 {
|
for y := -math.Pi; y <= math.Pi; y += 0.008 {
|
||||||
|
|
Loading…
Reference in a new issue