common

package
v0.0.0-...-af25fee Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Black = color.RGBA{0, 0, 0, 255}

Black color

View Source
var Blue = color.RGBA{0, 0, 255, 255}

Blue color

View Source
var Green = color.RGBA{0, 255, 0, 255}

Green color

View Source
var Red = color.RGBA{255, 0, 0, 255}

Red color

View Source
var White = color.RGBA{255, 255, 255, 255}

White color

Functions

func GetIntersections

func GetIntersections(A, B, C, R float64) (float64, float64, float64, float64)

GetIntersections Get the next intersection between a circle centered at {0,0} with radius = R and a line with equation Ax + By + C = 0

func NCInit

func NCInit() *gc.Window

NCInit Initialize a ncurses window

func Radian

func Radian(angle float64) float64

Radian convert degrees to radian

Types

type Dict

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

Dict dictionnary

func NewDict

func NewDict(inputFile string) *Dict

NewDict Build a new dictionnary from an input file (1 word by line)

func (*Dict) ToDot

func (D *Dict) ToDot()

ToDot dictionnary to dot file

type SDL

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

SDL structure

func SDLInit

func SDLInit(w, h int32) *SDL

SDLInit Initialize a SDL window

func (*SDL) Circle

func (S *SDL) Circle(x0, y0, R int, C color.RGBA, T int)

Circle Draw a circle of center (x0, y0) and radius R with color C and thickness T

func (*SDL) Clean

func (S *SDL) Clean()

Clean the surface

func (*SDL) Line

func (S *SDL) Line(x1, y1, x2, y2 int, C color.RGBA, T int)

Line Draw a line from (x1, y1) to (x2, y2) with color C and thickness T

func (*SDL) Refresh

func (S *SDL) Refresh()

Refresh update surface

func (*SDL) Sector

func (S *SDL) Sector(x0, y0, R int, C color.RGBA, T int)

Sector Draw a circle sector of center (x0, y0) and radius R with color C and thickness T

func (*SDL) Set

func (S *SDL) Set(x, y int, C color.RGBA, T int)

Set set a point at coordiantes (x,y) with color C and thickness T

func (*SDL) Wait

func (S *SDL) Wait()

Wait end of SDL window with crtl-c

Jump to

Keyboard shortcuts

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