aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-03 22:23:13 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-03 22:23:13 +0200
commit15abd14a6509bc0c469b9776ac3c436cb00ad32a (patch)
tree9583a483aee62ffdb952137888f106771810f364
parent05b47262e327607d5da1b3e8ff6336d0e5eaa77c (diff)
Switch to float
-rw-r--r--cutter.go4
-rw-r--r--misc.go7
2 files changed, 6 insertions, 5 deletions
diff --git a/cutter.go b/cutter.go
index 496fa3a..3b8d2ef 100644
--- a/cutter.go
+++ b/cutter.go
@@ -23,7 +23,7 @@ func (p Point) AddY(u float64) Point {
}
type Polar struct {
- R, Theta int
+ R, Theta float64
}
type Path []Point
@@ -391,7 +391,7 @@ func (c Cutter) Curve(a int, ph Path) {
c.Flush()
}
-func (c Cutter) Ellipse(a int, p Point, start, end Polar, theta int) {
+func (c Cutter) Ellipse(a int, p Point, start, end Polar, theta float64) {
c.Send(")", a, ",", p, ",", start.R, ",", end.R, ",",
start.Theta, ",", end.Theta, ",", theta)
}
diff --git a/misc.go b/misc.go
index 07ef7d3..6ea5aa9 100644
--- a/misc.go
+++ b/misc.go
@@ -4,7 +4,8 @@ func (c Cutter) DrawAtom() {
base := Point{2000, 2000}
for i := 0; i < 3; i++ {
c.Ellipse(0, base,
- Polar{500, 0}, Polar{200, 3600}, 600*i)
+ Polar{500, 0}, Polar{200, 3600},
+ 600*float64(i))
}
c.Circle(base, Polar{100, 0}, Polar{100, 3600})
}
@@ -21,7 +22,7 @@ func (c Cutter) DrawCircles() {
base := Point{3000, 2000}
for i := 1; i < 10; i++ {
c.Circle(base,
- Polar{100 * i, 0},
- Polar{100 * i, 3600})
+ Polar{100 * float64(i), 0},
+ Polar{100 * float64(i), 3600})
}
}