Length returns the length of OP.
()
| 315 | |
| 316 | // Length returns the length of OP. |
| 317 | func (p Point) Length() float64 { |
| 318 | return math.Hypot(p.X, p.Y) // sqrt(p.X^2 + p.Y^2) |
| 319 | } |
| 320 | |
| 321 | // Slope returns the slope between OP, i.e. y/x. |
| 322 | func (p Point) Slope() float64 { |
no outgoing calls