func Triangle(right, left, top point.Coord, c ColorDef) string { cType := "tw" if c == BLACK { cType = "tb" } return fmt.Sprintf(triTemplate, twop(right.Xf()), twop(right.Yf()), twop(left.Xf()), twop(left.Yf()), twop(top.Xf()), twop(top.Yf()), cType) }
func Circle(pt point.Coord, r float64, c ColorDef) string { return fmt.Sprintf(circleTemplate, c, twop(pt.Xf()), twop(pt.Yf()), twop(r)) }
func Cross(tl, bl, br, tr point.Coord, c ColorDef) string { cType := "xw" if c == BLACK { cType = "xb" } return fmt.Sprintf(crossTemplate, twop(tl.Xf()), twop(tl.Yf()), twop(br.Xf()), twop(br.Yf()), twop(bl.Xf()), twop(bl.Yf()), twop(tr.Xf()), twop(tr.Yf()), cType) }
func Line(s, e point.Coord) string { return fmt.Sprintf(lineTemplate, twop(s.Xf()), twop(s.Yf()), twop(e.Xf()), twop(e.Yf())) }
func WhiteDisc(pt point.Coord, r float64) string { return fmt.Sprintf(discTemplate, twop(pt.Xf()), twop(pt.Yf()), twop(r)) }
func Text(pt point.Coord, size float64, chars string, c ColorDef) string { fsize := twop(size) - 2 return fmt.Sprintf(textTemplate, chars, twop(pt.Xf()), twop(pt.Yf()-fsize/3), c) }
func Square(tl, bl, br, tr point.Coord, c ColorDef) string { cType := "qw" if c == BLACK { cType = "qb" } return fmt.Sprintf(squareTemplate, twop(tl.Xf()), twop(tl.Yf()), twop(bl.Xf()), twop(bl.Yf()), twop(br.Xf()), twop(br.Yf()), twop(tr.Xf()), twop(tr.Yf()), cType) }