You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The motivation behind this package is to find a better way to write vector math
8
8
in Golang, there has to be a more expressive way without it getting to verbose.
@@ -12,20 +12,22 @@ well. You should properly take a look at [`gonum`](https://github.com/gonum/gonu
12
12
13
13
## Install
14
14
```sh
15
-
go get github.com/kvartborg/vector
15
+
go get github.com/quartercastle/vector
16
16
```
17
17
18
18
## Usage
19
-
Golang does not have a way to define generic types yet, which
20
-
limits this package to operate with vectors represented as `float64` values only.
21
-
To allow for multi-dimensional vectors, a vector is simply represented as
22
-
a list of `float64` values.
23
19
```go
24
-
// A Vector is simply a list of float64 values
25
-
typeVector []float64
20
+
package main
21
+
22
+
import"github.com/quartercastle/vector"
23
+
24
+
type vec = vector.Vector
25
+
26
+
funcmain() {
27
+
a, b:= vec{1, 2}, vec{3, 4}
28
+
c:= a.Add(b)
29
+
}
26
30
```
27
-
> I will consider adding `float32` and `int` support at a later stage,
28
-
if there is a good reason or when go adds generics to the language.
29
31
30
32
### Tackling verbosity
31
33
Another goal of this experiment is to minimize the verbosity around using the package,
@@ -73,7 +75,7 @@ v2 := v1[1:] // returns a new vec{2, 3}
73
75
```
74
76
75
77
## Documentation
76
-
The full documentation of the package can be found on [godoc](https://pkg.go.dev/github.com/kvartborg/vector?tab=doc).
78
+
The full documentation of the package can be found on [godoc](https://pkg.go.dev/github.com/quartercastle/vector?tab=doc).
77
79
78
80
## Contributions
79
81
Contributions with common vector operations that are not included in this package are welcome.
@@ -82,4 +84,4 @@ Contributions with common vector operations that are not included in this packag
82
84
Thanks to [`gonum`](https://github.com/gonum/gonum) for inspiration and the following functions [`axpyUnitaryTo`](https://github.com/gonum/gonum/blob/master/internal/asm/f64/axpyunitaryto_amd64.s), [`scalUnitaryTo`](https://github.com/gonum/gonum/blob/c3867503e73e5c3fee7ab93e3c2c562eb2be8178/internal/asm/f64/scalunitaryto_amd64.s) that enhances the performance of arithmetic operations in this package.
83
85
84
86
## License
85
-
This project is licensed under the [MIT License](https://github.com/kvartborg/vector/blob/master/LICENSE) and includes [`gonum`](https://github.com/gonum/gonum) code that is licensed under [3-Clause BSD license](https://github.com/gonum/gonum/blob/master/LICENSE).
87
+
This project is licensed under the [MIT License](https://github.com/quartercastle/vector/blob/master/LICENSE) and includes [`gonum`](https://github.com/gonum/gonum) code that is licensed under [3-Clause BSD license](https://github.com/gonum/gonum/blob/master/LICENSE).
0 commit comments