#159 Another reduction of Simplify Matrix.Unproject formulas

This commit is contained in:
Jacek Olszak 2019-02-12 21:06:37 +01:00
parent b0ed22e0ec
commit 2e0da4f44a
1 changed files with 2 additions and 2 deletions

View File

@ -405,7 +405,7 @@ func (m Matrix) Project(u Vec) Vec {
func (m Matrix) Unproject(u Vec) Vec {
det := m[0]*m[3] - m[2]*m[1]
return Vec{
(m[3]*u.X - m[2]*u.Y + m[2]*m[5] - m[3]*m[4]) / det,
(-m[1]*u.X + m[0]*u.Y + m[1]*m[4] - m[0]*m[5]) / det,
(m[3]*(u.X-m[4]) - m[2]*(u.Y-m[5])) / det,
(-m[1]*(u.X-m[4]) + m[0]*(u.Y-m[5])) / det,
}
}