MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Rotate

Method Rotate

utils.go:229–235  ·  view source on GitHub ↗
(angle float32)

Source from the content-addressed store, hash-verified

227}
228
229func (point Vector) Rotate(angle float32) Vector {
230 x := point.X
231 y := point.Y
232 point.X = x*float32(math.Cos(float64(angle))) - y*float32(math.Sin(float64(angle)))
233 point.Y = x*float32(math.Sin(float64(angle))) + y*float32(math.Cos(float64(angle)))
234 return point
235}
236
237func (point Vector) Negated() Vector {
238 return Vector{-point.X, -point.Y}

Callers 3

ThickLineFunction · 0.45
DrawMethod · 0.45
ConstructMenusFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected