Documentation
¶
Index ¶
- func Abs[T Numbers](v T) T
- func GCD(nums ...int) int
- func LCM(nums ...int) int
- func Mod(a, b int) int
- func Must(err error)
- func ReadAllInput() []string
- func ReadAllInputFromFile(name string) []string
- func Sign[T Numbers](v T) int
- func StrToInt(str string) int
- func StrToInts(str string) []int
- type Fraction
- func (f Fraction) Add(s int) Fraction
- func (f Fraction) Div(f2 Fraction) Fraction
- func (f1 Fraction) Equals(f2 Fraction) bool
- func (f Fraction) Float() float64
- func (f Fraction) Mul(s int) Fraction
- func (f Fraction) Simplify() Fraction
- func (f Fraction) String() string
- func (f Fraction) Sub(s int) Fraction
- type Numbers
- type Vector2
- func (v Vector2[T]) Add(av Vector2[T]) Vector2[T]
- func (v Vector2[T]) ManhattanDst(v2 Vector2[T]) T
- func (v Vector2[T]) Mul(scalar T) Vector2[T]
- func (v Vector2[T]) Norm() Vector2[T]
- func (v Vector2[T]) RotateLeft() Vector2[T]
- func (v Vector2[T]) RotateRight() Vector2[T]
- func (v Vector2[T]) String() string
- func (v Vector2[T]) Sub(av Vector2[T]) Vector2[T]
- type Vector3
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadAllInput ¶
func ReadAllInput() []string
func ReadAllInputFromFile ¶
Types ¶
type Fraction ¶
func NewFraction ¶
type Vector2 ¶
type Vector2[T Numbers] struct { X T Y T }
func NewVector2 ¶
func (Vector2[T]) ManhattanDst ¶
func (Vector2[T]) RotateLeft ¶
RotateLeft rotates the vector to the left (left-handed system)
func (Vector2[T]) RotateRight ¶
RotateRight rotates the vector to the right (left-handed system)
Click to show internal directories.
Click to hide internal directories.