Skip to content

shindakun/vec3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

vec3

vec3 gopher

Simple Golang vector3 library, basically the same as the one presented on Games With Go episode 13.

Installation

If you are a Go user you can run go install github.com/shindakun/vec3.

Functions

func Distance(a, b Vector3) float32
func DistanceSquared(a, b Vector3) float32
func Add(a, b Vector3) Vector3
func Mult(a Vector3, b float32) Vector3
func Normalize(a Vector3) Vector3
func (a Vector3) Length() float32

Usage example

The following code

v1 := vec3.Vector3{X: 1, Y: 1, Z: 0}
v2 := vec3.Vector3{X: 1, Y: 1, Z: 0}
newV := vec3.Add(v1, v2)
fmt.Println(newV)

results in the new vector of {2 2 0}.

About

Simple Golang vector3 library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages