aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go4
-rw-r--r--pic.go6
-rw-r--r--units.go8
3 files changed, 14 insertions, 4 deletions
diff --git a/main.go b/main.go
index ecdeaf9..20a83c0 100644
--- a/main.go
+++ b/main.go
@@ -36,4 +36,8 @@ func main() {
fmt.Println("Lower Left", c.ReadLowerLeft())
//fmt.Println(c.StatusWord())
+ if c.SearchMarks(Point{19 * CM, 18 * CM}, 2*CM) {
+ fmt.Println("Reg Marks ok")
+ }
+
}
diff --git a/pic.go b/pic.go
index 7a0a690..605818d 100644
--- a/pic.go
+++ b/pic.go
@@ -10,8 +10,6 @@ import (
type Page []Path
-const scale = 24.5 * 20
-
func truncate(f float64) float64 {
return float64(int(f*100)) / 100
}
@@ -21,8 +19,8 @@ func parseLine(s string) (pa Path) {
for _, p := range strings.Split(s[10:], " to ") {
var po Point
fmt.Sscanf(p, "%v,%v", &po.Y, &po.X)
- po.X = truncate(5440 - po.X*scale)
- po.Y = truncate(po.Y * scale)
+ po.X = truncate(5440 - po.X*Inch)
+ po.Y = truncate(po.Y * Inch)
pa = append(pa, po)
}
}
diff --git a/units.go b/units.go
new file mode 100644
index 0000000..7a6ab47
--- /dev/null
+++ b/units.go
@@ -0,0 +1,8 @@
+package main
+
+const (
+ MM = 20.0
+ CM = 10 * MM
+ DM = 10 * CM
+ Inch = 25.4 * MM
+)