RotateRad rotates m counter-clockwise by rad radians.
(rad float32)
| 266 | |
| 267 | // RotateRad rotates m counter-clockwise by rad radians. |
| 268 | func (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 |
no test coverage detected