diff options
Diffstat (limited to 'vendor/github.com/golang/geo/s2/matrix3x3.go')
| -rw-r--r-- | vendor/github.com/golang/geo/s2/matrix3x3.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/vendor/github.com/golang/geo/s2/matrix3x3.go b/vendor/github.com/golang/geo/s2/matrix3x3.go index 1f78d5d..048419f 100644 --- a/vendor/github.com/golang/geo/s2/matrix3x3.go +++ b/vendor/github.com/golang/geo/s2/matrix3x3.go @@ -18,6 +18,8 @@ package s2 import ( "fmt" + + "github.com/golang/geo/r3" ) // matrix3x3 represents a traditional 3x3 matrix of floating point values. @@ -27,12 +29,12 @@ type matrix3x3 [3][3]float64 // col returns the given column as a Point. func (m *matrix3x3) col(col int) Point { - return PointFromCoords(m[0][col], m[1][col], m[2][col]) + return Point{r3.Vector{m[0][col], m[1][col], m[2][col]}} } // row returns the given row as a Point. func (m *matrix3x3) row(row int) Point { - return PointFromCoords(m[row][0], m[row][1], m[row][2]) + return Point{r3.Vector{m[row][0], m[row][1], m[row][2]}} } // setCol sets the specified column to the value in the given Point. @@ -65,11 +67,11 @@ func (m *matrix3x3) scale(f float64) *matrix3x3 { // mul returns the multiplication of m by the Point p and converts the // resulting 1x3 matrix into a Point. func (m *matrix3x3) mul(p Point) Point { - return PointFromCoords( - m[0][0]*p.X+m[0][1]*p.Y+m[0][2]*p.Z, - m[1][0]*p.X+m[1][1]*p.Y+m[1][2]*p.Z, - m[2][0]*p.X+m[2][1]*p.Y+m[2][2]*p.Z, - ) + return Point{r3.Vector{ + m[0][0]*p.X + m[0][1]*p.Y + m[0][2]*p.Z, + m[1][0]*p.X + m[1][1]*p.Y + m[1][2]*p.Z, + m[2][0]*p.X + m[2][1]*p.Y + m[2][2]*p.Z, + }} } // det returns the determinant of this matrix. |
