MCPcopy
hub / github.com/EngoEngine/engo / RotateRad

Method RotateRad

math.go:268–286  ·  view source on GitHub ↗

RotateRad rotates m counter-clockwise by rad radians.

(rad float32)

Source from the content-addressed store, hash-verified

266
267// RotateRad rotates m counter-clockwise by rad radians.
268func (m *Matrix) RotateRad(rad float32) *Matrix {
269 if rad == 0 {
270 return m
271 }
272 sin, cos := math.Sincos(rad)
273 m.tmp[m00] = cos
274 m.tmp[m10] = sin
275 m.tmp[m20] = 0
276
277 m.tmp[m01] = -sin
278 m.tmp[m11] = cos
279 m.tmp[m21] = 0
280
281 m.tmp[m02] = 0
282 m.tmp[m12] = 0
283 m.tmp[m22] = 1
284 multiplyMatricies(m.Val[:], m.tmp[:])
285 return m
286}
287
288// PointSide returns which side of the line l the point p sits on
289// true means the point is below/left of the line

Callers 1

RotateMethod · 0.95

Calls 2

SincosFunction · 0.92
multiplyMatriciesFunction · 0.85

Tested by

no test coverage detected