normgeom

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 1 Imported by: 9

Documentation

Overview

Package normgeom contains similar structs to the geom package, except all coordinates are normalized between 0 and 1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dist

func Dist(a, b NormPoint) float64

Dist calculates the distance between two NormPoint's.

Types

type NormPoint

type NormPoint struct {
	X float64
	Y float64
}

NormPoint represents a 2D point with coordinates between 0 and 1.

func (*NormPoint) Constrain

func (p *NormPoint) Constrain()

Constrain constrains a NormPoint's X and Y values to between 0 and 1.

type NormPointGroup

type NormPointGroup []NormPoint

NormPointGroup represents a group of NormPoint's.

func (NormPointGroup) Copy

func (p NormPointGroup) Copy() NormPointGroup

Copy creates a deep copy of a NormPointGroup.

func (NormPointGroup) Set

func (p NormPointGroup) Set(other NormPointGroup)

Set sets a NormPointGroup to another NormPointGroup. The lengths of the NormPointGroup's cannot be different.

type NormPolygon added in v1.1.7

type NormPolygon struct {
	Points []NormPoint
}

Polygon represents a n-gon with integer coordinates.

type NormTriangle

type NormTriangle struct {
	Points [3]NormPoint
}

NormTriangle represents a triangle with normalized coordinates.

func NewNormTriangle

func NewNormTriangle(x0, y0, x1, y1, x2, y2 float64) NormTriangle

NewNormTriangle returns a new NormTriangle.

Jump to

Keyboard shortcuts

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