MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / DegreesToAngle

Function DegreesToAngle

util/rot.go:5–7  ·  view source on GitHub ↗
(degrees float32)

Source from the content-addressed store, hash-verified

3import "math"
4
5func DegreesToAngle(degrees float32) byte {
6 return byte(math.Round(float64(degrees) * (256.0 / 360.0)))
7}
8
9func AngleToDegrees(angle byte) float32 {
10 return float32(angle) * (360.0 / 256.0)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected