MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Vector

Struct Vector

math/pythagoras/pythagoras.go:8–12  ·  view source on GitHub ↗

Vector defines a tuple with 3 values in 3d-space

Source from the content-addressed store, hash-verified

6
7// Vector defines a tuple with 3 values in 3d-space
8type Vector struct {
9 x float64
10 y float64
11 z float64
12}
13
14// Distance calculates the distance between to vectors with the Pythagoras theorem
15func Distance(a, b Vector) float64 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected