package clockface
import (
"fmt"
"io"
"time"
)
const secondHandLength = 90
const clockCentreX = 150
const clockCentreY = 150
const svgStart = `
`
//SVGWriter writes an SVG representation of an analog clock, showing the time t, to the writer w
func SVGWriter(w io.Writer, t time.Time) {
io.WriteString(w, svgStart)
io.WriteString(w, bezel)
SecondHand(w, t)
io.WriteString(w, svgEnd)
}
func SecondHand(w io.Writer, t time.Time) {
p := secondHandPoint(t)
p = Point{p.X * secondHandLength, p.Y * secondHandLength} //scale
p = Point{p.X, -p.Y} //flip
p = Point{p.X + clockCentreX, p.Y + clockCentreY} //translate
fmt.Fprintf(w, ``, p.X, p.Y)
}