diff --git a/CustomView/Advance/[10]Matrix_Method.md b/CustomView/Advance/[10]Matrix_Method.md index bcaa18d..8d77f40 100644 --- a/CustomView/Advance/[10]Matrix_Method.md +++ b/CustomView/Advance/[10]Matrix_Method.md @@ -24,6 +24,50 @@ ## Matrix方法详解 +### 构造方法 + +构造方法没有在上面表格中列出。 + +**无参构造** + +``` +Matrix () +``` +创建一个全新的Matrix,使用格式如下: + +``` +Matrix matrix = new Matrix(); +``` + +通过这种方式创建出来的并不是一个数值全部为空的矩阵,而是一个单位矩阵,如下: + +![](http://latex.codecogs.com/png.latex? +$$ +\\left [ +\\begin{matrix} +1 & 0 & 0 \\\\ +0 & 1 & 0 \\\\ +0 & 0 & 1 +\\end{1} +\\right ] +$$) + + +**有参构造** + +``` +Matrix (Matrix src) +``` + +这种方法则需要一个已经存在的矩阵作为参数,如下: + +``` +Matrix matrix = new Matrix(src); +``` + +创建一个Matrix,并对src深拷贝(理解为新的matrix和src是两个对象,但内部数值相同即可)。 + + ### 基本方法 基本方法内容比较简单,在此处简要介绍一下。 @@ -38,6 +82,7 @@ toShortString | 将Matrix转换为短字符串
`[1.0, 0.0, 0.0][0.0, 1.0, 0. ### 数值操作 + ### 数值计算 ### set pre 与 post