Norm normalises OP to be of given length.
(length float64)
| 335 | |
| 336 | // Norm normalises OP to be of given length. |
| 337 | func (p Point) Norm(length float64) Point { |
| 338 | d := p.Length() |
| 339 | if d == 0.0 { |
| 340 | return Point{} |
| 341 | } |
| 342 | return Point{p.X / d * length, p.Y / d * length} |
| 343 | } |
| 344 | |
| 345 | // Transform transforms the point by affine transformation matrix m. |
| 346 | func (p Point) Transform(m Matrix) Point { |