summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-01-06 00:20:54 +0100
committerDimitri Sokolyuk <demon@dim13.org>2017-01-06 00:20:54 +0100
commitf4951f468ac7a85499d0d24738a4e0f907ca21a8 (patch)
treec518b398636ccc6817ae227ba2e07cabc42f1fec
parent75b136a14db62dd406645c119dc7b02c6cb064a6 (diff)
Symmetric matrix
-rw-r--r--bezier.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/bezier.go b/bezier.go
index 9bfb1f0..1add5c3 100644
--- a/bezier.go
+++ b/bezier.go
@@ -4,7 +4,7 @@ import "github.com/gonum/matrix/mat64"
var mb = []float64{-1, 3, -3, 1, 3, -6, 3, 0, -3, 3, 0, 0, 1, 0, 0, 0}
-func vector(x float64) []float64 {
+func newVector(x float64) []float64 {
v := make([]float64, 4)
v[3] = 1
v[2] = x * v[3]
@@ -14,7 +14,7 @@ func vector(x float64) []float64 {
}
func Vector(x float64) *mat64.Vector {
- return mat64.NewVector(4, vector(x))
+ return mat64.NewVector(4, newVector(x))
}
func Matrix(m []float64) *mat64.Dense {
@@ -29,7 +29,7 @@ func mult(U, V *mat64.Vector, Mb, Gb *mat64.Dense) float64 {
m1 := new(mat64.Dense)
m2 := new(mat64.Dense)
m1.Mul(Mb, Gb)
- m2.Mul(m1, Mb.T())
+ m2.Mul(m1, Mb)
return mat64.Inner(U, m2, V)
}