From 15abd14a6509bc0c469b9776ac3c436cb00ad32a Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 3 May 2015 22:23:13 +0200 Subject: Switch to float --- cutter.go | 4 ++-- misc.go | 7 ++++--- 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}) } } -- cgit v1.2.3