gonum: gonum.org/v1/gonum/spatial/r2 Index | Files

package r2

import "gonum.org/v1/gonum/spatial/r2"

Package r2 provides 2D vectors and boxes and operations on them.

Index

Package Files

doc.go vector.go

type Box Uses

type Box struct {
    Min, Max Vec
}

Box is a 2D bounding box.

type Vec Uses

type Vec struct {
    X, Y float64
}

Vec is a 2D vector.

func (Vec) Add Uses

func (p Vec) Add(q Vec) Vec

Add returns the vector sum of p and q.

func (Vec) Scale Uses

func (p Vec) Scale(f float64) Vec

Scale returns the vector p scaled by f.

func (Vec) Sub Uses

func (p Vec) Sub(q Vec) Vec

Sub returns the vector sum of p and -q.

Package r2 is imported by 1 packages. Updated 2019-05-16. Refresh now. Tools for package owners.