aoc

package
v0.0.0-...-ba081df Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(a int) int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func MinMax

func MinMax(data []int) (min, max int)

func PanicIfError

func PanicIfError(err error)

func ReadAllInput

func ReadAllInput() []string

func ReadAllInputFromFile

func ReadAllInputFromFile(name string) []string

func StrToInt

func StrToInt(s string) int

func StrToInts

func StrToInts(s string, sep string) []int

Types

type Matrix3x3

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

func NewIdentityMatrix3x3

func NewIdentityMatrix3x3() Matrix3x3

func NewMatrix3x3

func NewMatrix3x3(values [9]int) Matrix3x3

func RotationMatrixXY

func RotationMatrixXY(angle int) Matrix3x3

func RotationMatrixXZ

func RotationMatrixXZ(angle int) Matrix3x3

func RotationMatrixYZ

func RotationMatrixYZ(angle int) Matrix3x3

func (Matrix3x3) Mul

func (m Matrix3x3) Mul(am Matrix3x3) Matrix3x3

func (Matrix3x3) MulVector3

func (m Matrix3x3) MulVector3(v Vector3) Vector3

type Vector2

type Vector2 struct {
	X, Y int
}

Vector2 represents a two-dimensional vector in left-handed Cartesian coordinate system

func NewVector2

func NewVector2(x, y int) Vector2

func (Vector2) Add

func (v Vector2) Add(s Vector2) Vector2

func (Vector2) Adjacent

func (v Vector2) Adjacent() []Vector2

func (Vector2) Mul

func (v Vector2) Mul(scalar int) Vector2

func (Vector2) Norm

func (v Vector2) Norm() Vector2

func (Vector2) Rotate

func (v Vector2) Rotate(rm [2][2]int) Vector2

func (Vector2) RotateLeft

func (v Vector2) RotateLeft() Vector2

func (Vector2) RotateRight

func (v Vector2) RotateRight() Vector2

func (Vector2) Sub

func (v Vector2) Sub(s Vector2) Vector2

type Vector3

type Vector3 struct {
	X, Y, Z int
}

func NewVector3

func NewVector3(x, y, z int) Vector3

func (Vector3) Add

func (v Vector3) Add(av Vector3) Vector3

func (Vector3) ManhattanLength

func (v Vector3) ManhattanLength() int

func (Vector3) Sub

func (v Vector3) Sub(av Vector3) Vector3

Jump to

Keyboard shortcuts

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