IsTranslation is true if the matrix consists of only translational components, i.e. no rotation, scaling, or skew transformations.
()
| 806 | |
| 807 | // IsTranslation is true if the matrix consists of only translational components, i.e. no rotation, scaling, or skew transformations. |
| 808 | func (m Matrix) IsTranslation() bool { |
| 809 | return Equal(m[0][0], 1.0) && Equal(m[0][1], 0.0) && Equal(m[1][0], 0.0) && Equal(m[1][1], 1.0) && (!Equal(m[0][2], 0.0) || !Equal(m[1][2], 0.0)) |
| 810 | } |
| 811 | |
| 812 | // IsScaling is true if the matrix consists of only scaling components, i.e. no rotation, or skew transformations (but may translate). |
| 813 | func (m Matrix) IsScaling() bool { |