disco

package module
v0.0.0-...-915c7d5 Latest Latest
Warning

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

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

README

disco

Primative Drawing for a current project.

Nothing to see at this time. Hell, I dont even know if it will work.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X float64
	Y float64
}

func Rotate

func Rotate(p Point, angle float64) Point

Rotate : Rotate a point by angle radians. Best if translated to origin.

func Scale

func Scale(p Point, scalefactor float64) Point

Scale : Scale a simple point by scale factor.

func Translate

func Translate(p Point, tx float64, ty float64) Point

Translate : Translate a simple point by tx,ty

type Rectangle

type Rectangle struct {
	Points [4]Point
	Center Point
	Color  color.Color
}

func (*Rectangle) CalcCenter

func (r *Rectangle) CalcCenter()

func (*Rectangle) Draw

func (r *Rectangle) Draw(width, height int) *image.RGBA

type Triangle

type Triangle struct {
	Points [3]Point
	Center Point
	Color  color.Color
}

func (*Triangle) CalcCenter

func (t *Triangle) CalcCenter()

func (*Triangle) Draw

func (t *Triangle) Draw(width, height int) *image.RGBA

func (*Triangle) Rotate

func (t *Triangle) Rotate(angle float64) Triangle

Rotate : Rotate a triangle around its assumed centerpoint Brst if t has already been translated to the origin. Calculates a new center.

func (Triangle) Scale

func (t Triangle) Scale(factor float64) Triangle

func (*Triangle) Translate

func (t *Triangle) Translate(tx, ty float64) Triangle

Translate : Translate a triangle t by tx,ty referenced from the center. Center is assumed to be already calculated.

Jump to

Keyboard shortcuts

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