plot3

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

README

plot3

plotspiral

Log spiral plot

3D plots using fogleman/ln library with the hope of someday being incorporated into gonum's plot library.

Examples

See plot_test.go

Contributing

For the love of god help me

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Plot

func Plot(filename string, xyz XYZer)

Plot does a 3D lineplot using fogleman/ln library

Types

type Curve

type Curve struct {
	XYZs
	color.Color
	// contains filtered or unexported fields
}

Curve defines a 3D Curve. Points are ordered

func NewCurve

func NewCurve(xyz XYZer) Curve

NewCurve Creates new curve ready to graph from XYZer

func (Curve) BoundingBox

func (c Curve) BoundingBox() ln.Box

BoundingBox ln.Shape interface implementation

func (Curve) Compile

func (c Curve) Compile()

Compile ln.Shape interface implementation

func (Curve) Contains

func (c Curve) Contains(ln.Vector, float64) bool

Contains ln.Shape interface implementation

func (Curve) Intersect

func (c Curve) Intersect(ln.Ray) ln.Hit

Intersect ln.Shape interface implementation

func (Curve) Max

func (c Curve) Max() (float64, float64, float64)

Max Like Min but maximum values

func (Curve) Min

func (c Curve) Min() (float64, float64, float64)

Min returns minimum x, y and z values of a Curve.

The numbers returned do NOT define a point of the Curve.

func (Curve) Paths

func (c Curve) Paths() ln.Paths

Paths ln.Shape interface implementation

func (Curve) Plot

func (c Curve) Plot(canvas draw.Canvas, plt *plot.Plot)

Plot implements gonum's Plotter interface

type XYZer

type XYZer interface {
	// Len returns the number of x, y, z triples.
	Len() int

	// XYZ returns an x, y, z triple.
	XYZ(int) (float64, float64, float64)
}

XYZer wraps the Len and XYZ methods.

func XYZerFromSlices

func XYZerFromSlices(x, y, z []float64) XYZer

XYZerFromSlices generates XYZer interface from a set of points (x[i] corresponds to y[i] and z[i])

type XYZs

type XYZs ln.Path

XYZs implements the XYZer interface using a slice.

func CopyXYZs

func CopyXYZs(data XYZer) XYZs

CopyXYZs copies an XYZer.

func (XYZs) Len

func (xyz XYZs) Len() int

Len implements the Len method of the XYZer interface.

func (XYZs) XYZ

func (xyz XYZs) XYZ(i int) (float64, float64, float64)

XYZ returns a point in space (3 element tuple)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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