clockface/clockface.go
mitch 9a21ca4d26 Updated testing
Added svgWriter
Refactored
2022-01-19 23:56:30 -05:00

23 lines
325 B
Go

package clockface
import (
"math"
"time"
)
type Point struct {
X float64
Y float64
}
func secondsInRadians(t time.Time) float64 {
return math.Pi / (30 / (float64(t.Second())))
}
func secondHandPoint(t time.Time) Point {
angle := secondsInRadians(t)
x := math.Sin(angle)
y := math.Cos(angle)
return Point{x, y}
}