Rot rotates the line OP by phi radians CCW.
(phi float64, p0 Point)
| 288 | |
| 289 | // Rot rotates the line OP by phi radians CCW. |
| 290 | func (p Point) Rot(phi float64, p0 Point) Point { |
| 291 | sinphi, cosphi := math.Sincos(phi) |
| 292 | return Point{ |
| 293 | p0.X + cosphi*(p.X-p0.X) - sinphi*(p.Y-p0.Y), |
| 294 | p0.Y + sinphi*(p.X-p0.X) + cosphi*(p.Y-p0.Y), |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | // Hadamard returns the Hadamard product, or the element-wise product, of the point. |
| 299 | func (p Point) Hadamard(q Point) Point { |
no outgoing calls