matrix

package
v0.0.0-...-5a4f024 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2015 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

package matrix

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
	Width   float32
	Squares [][]square.Square
}

func FindSmallerCellSize

func FindSmallerCellSize(pointList *[]point.Point) Matrix

FindSmallerCellSize find the matrix with the smaller cell size which contains points inside its cells

func New

func New(width float32, size int) Matrix

New creates a new matrix with a given size

func (*Matrix) Draw

func (m *Matrix) Draw(canvas *drawing.Canvas, strat Strategy)

Draw the matrix into the canvas using the `strat` Strategy

func (Matrix) GetSquare

func (m Matrix) GetSquare(i, j int) square.Square

GetSquare get square in position (i,j)

func (Matrix) Subdivide

func (m Matrix) Subdivide() *Matrix

Subdivide get the next iteration of matrix if every square of it was subidivided into a 4x4 submatrix

type Strategy

type Strategy interface {
	OrderPoints(sq square.Square)
	ConnectSquares(m Matrix) [][]*point.Point
}

Strategy interface defines the order inside the square and inside the matrix. this order will define how the matrix will be drawn there are examples of use in the `github.com/Willyfrog/peano/strategy` module

Jump to

Keyboard shortcuts

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