add doc.md

This commit is contained in:
Yongwei Xing 2021-03-08 15:56:32 +08:00
parent 3c935e11b9
commit f23d235c06
2 changed files with 97 additions and 3 deletions

View file

@ -31,7 +31,7 @@ For these kinds of art, the package provides as many as parameters to control th
## Install
The go version I used is go 1.16.
The go version I used is `Go 1.16`.
```bash
go get github.com/jdxyw/generativeart
@ -57,6 +57,13 @@ NewColorCircle2(circleNum int)
NewCircleGrid(circleNumMin, circleNumMax int)
```
## Docs
You could find the docs in the [doc](./docs).
## Examples
You could find examples for all types under [example](./example).
## General Options
```go
@ -73,7 +80,7 @@ type Options struct {
The `Options` is a global option for the whole `canva`. It includes those general parameters used by different kinds of types, such as `background`, `lineColor`, and `colorScheme`.
For those parameters specified for different kinds of art type, they have their own `struct`.
For those parameters specified for different kinds of art types, they have their own `struct`.
## Usage and example
### Junas
@ -115,7 +122,7 @@ func main() {
![](images/randomshape.png)
### Color Circle
### Color Circle2
```go
func main() {

87
docs/doc.md Normal file
View file

@ -0,0 +1,87 @@
## Color Circle 2
`Color Circle2` is version 2 of `Color Circle`. It still draws circle and point cloud.
### parameters
- circleNum: The number of circle in this drawing.
```go
cc := generativeart.NewColorCircle2(30)
```
![](../images/colorcircle2.png)
## Dot Line
`dot line` would draw images with short dot and short. The short lines would compose as a big circle.
### parameters
- n: The number of element in this image.
- ras/canv: Control the appearance of this image.
- randColor: Use the the specified color or random colors.
```go
dl := generativeart.NewDotLine(100, 20, 50, false)
```
![](../images/dotline.png)
## Random Shape
`random shape` would draw images with random shapes. The whole image would rotate with some degree.
### parameters
- shapeNum: It indicates how many shapes you want to draw.
```go
rs := NewRandomShape(150)
```
![](../images/randomshape.png)
## Janus
`Janus` would draws a image with multiple circles split at its center with random noise in the horizontal direction.
### TODO
### parameters
## Silk Sky
`Silk Sky` would draws a image with multiple circles converge to one point or circle.
### parameters
- circleNum: The number of the circles in this drawing.
- sunRadius: The radius of the sun. The sun is a point/circle where other circles meet.
```go
silkSky := NewSilkSky(circleNum int, sunRadius float64)
```
![](../images/silksky.png)
## Julia
`Julia` is to draw a `Julia Set`. [Julia Set](https://en.wikipedia.org/wiki/Julia_set) is a math concept. You can define your own formula in this package.
### parameters
- fn: The custom julia set function.
- maxz: The maximum modulus length of a complex number.
- xaixs, yaixs: The range for the X-Y coordination used to mapping the julia set number to the real pixel of the image. These should be positive number. It only indicates the first quadrant range.
```go
func julia1(z complex128) complex128 {
c := complex(-0.1, 0.651)
z = z*z + c
return z
}
julia := generativeart.NewJulia(julia1, 40, 1.5, 1.5)
```
![](../images/julia.png)