/go-vector

A Vector library for 2D applications.

Primary LanguageGoMIT LicenseMIT

go-vector

A Vector library for 2D applications. Forked from deeean/go-vector, with the main change being that the vector parameters aren't pointers, and the struct is generically typed.

github-actions codecov

Installation

go get -u github.com/Lundis/go-vector/vector2

Usage

package main

import (
	"fmt"
	"github.com/Lundis/go-vector/vector2"
)

func main() {
	// basic usage
	a := vector2.NewFloat64(1, 2)
	b := vector2.NewFloat32(3, 4)
	fmt.Println(vector2.Add(a, b))
}