MCPcopy
hub / github.com/tdewolff/canvas / Length

Method Length

util.go:317–319  ·  view source on GitHub ↗

Length returns the length of OP.

()

Source from the content-addressed store, hash-verified

315
316// Length returns the length of OP.
317func (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.
322func (p Point) Slope() float64 {

Callers 3

TestPointFunction · 0.95
NormMethod · 0.95
DistanceToPointMethod · 0.45

Calls

no outgoing calls

Tested by 1

TestPointFunction · 0.76