本文整理汇总了Golang中otre/point.Coord.Xf方法的典型用法代码示例。如果您正苦于以下问题:Golang Coord.Xf方法的具体用法?Golang Coord.Xf怎么用?Golang Coord.Xf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类otre/point.Coord
的用法示例。
在下文中一共展示了Coord.Xf方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Cross
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)
}
示例2: Square
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)
}
示例3: Triangle
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)
}
示例4: Circle
func Circle(pt point.Coord, r float64, c ColorDef) string {
return fmt.Sprintf(circleTemplate, c, twop(pt.Xf()), twop(pt.Yf()), twop(r))
}
示例5: Line
func Line(s, e point.Coord) string {
return fmt.Sprintf(lineTemplate,
twop(s.Xf()), twop(s.Yf()), twop(e.Xf()), twop(e.Yf()))
}
示例6: WhiteDisc
func WhiteDisc(pt point.Coord, r float64) string {
return fmt.Sprintf(discTemplate, twop(pt.Xf()), twop(pt.Yf()), twop(r))
}
示例7: Text
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)
}