clarify doc

This commit is contained in:
faiface 2017-03-15 00:15:02 +01:00
parent a614c3020c
commit 7d1f685d4b
1 changed files with 4 additions and 0 deletions

View File

@ -281,6 +281,8 @@ func (m Matrix) Rotated(around Vec, angle float64) Matrix {
}
// Project applies all transformations added to the Matrix to a vector u and returns the result.
//
// Time complexity is O(1).
func (m Matrix) Project(u Vec) Vec {
m3 := mgl64.Mat3(m)
proj := m3.Mul3x1(mgl64.Vec3{u.X(), u.Y(), 1})
@ -288,6 +290,8 @@ func (m Matrix) Project(u Vec) Vec {
}
// Unproject does the inverse operation to Project.
//
// Time complexity is O(1).
func (m Matrix) Unproject(u Vec) Vec {
m3 := mgl64.Mat3(m)
inv := m3.Inv()