ellipse

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func XYFromDense

func XYFromDense(m *mat.Dense) plotter.XYs

XYFromDense returns plotter.XYs from m, which stores X and Y coordinates in its 1st and 2nd column. It panics if either m is nil or if m doesn't have at least 2 columns.

Types

type Ellipse

type Ellipse struct {
	// contains filtered or unexported fields
}

Ellipse is 2D ellipse

For more information see: https://en.wikipedia.org/wiki/Ellipse

func New

func New(x, y, a, b, angle float64) (*Ellipse, error)

New creates new Ellipse with origin [x,y], length of major/minor axis (mx,my) and rotation angle radians. It returns error if either of the axis (a or b). Note: the lengths of major/minor axis are defined as a distance between the ellipse vertices on major/minor axis. however, this function accepts semi-major/minor lengths from the Ellipse origin.

For more information please see: https://en.wikipedia.org/wiki/Semi-major_and_semi-minor_axes

func NewWithDataConfidence

func NewWithDataConfidence(data mat.Matrix, confidence float64) (*Ellipse, error)

NewWithDataConfidence creates new Ellipse from data with origin being data mean and confidence probability. The data is assumed to be of the Normal (a.k.a. Gaussian) distribution. It panics if either of the folllowing happens: * supplied data matrix is nil * principal components could not be calculated from the supplied data It returns error if confidence is not in (0,1> interval.

func (*Ellipse) Eccentricity

func (e *Ellipse) Eccentricity() float64

Eccentricity returns eccentricity of the ellipse

func (*Ellipse) LinePoints

func (e *Ellipse) LinePoints(size int) (*plotter.Line, *plotter.Scatter, error)

LinePoints returns both plotter.Line and plotter.Scatter which can be used to plot Ellipse. It returns error if at least one of the ellipse data points contains a NaN or Infinity.

func (*Ellipse) String

func (e *Ellipse) String() string

String implements fmt.Stringer interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL