Skip to content

Commit f7a57c3

Browse files
committed
Add constructor method
1 parent aeaac33 commit f7a57c3

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

‎CustomView/Advance/[10]Matrix_Method.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,50 @@
2424

2525
## Matrix方法详解
2626

27+
### 构造方法
28+
29+
构造方法没有在上面表格中列出。
30+
31+
**无参构造**
32+
33+
```
34+
Matrix ()
35+
```
36+
创建一个全新的Matrix,使用格式如下:
37+
38+
```
39+
Matrix matrix = new Matrix();
40+
```
41+
42+
通过这种方式创建出来的并不是一个数值全部为空的矩阵,而是一个单位矩阵,如下:
43+
44+
![](http://latex.codecogs.com/png.latex?
45+
$$
46+
\\left [
47+
\\begin{matrix}
48+
1 & 0 & 0 \\\\
49+
0 & 1 & 0 \\\\
50+
0 & 0 & 1
51+
\\end{1}
52+
\\right ]
53+
$$)
54+
55+
56+
**有参构造**
57+
58+
```
59+
Matrix (Matrix src)
60+
```
61+
62+
这种方法则需要一个已经存在的矩阵作为参数,如下:
63+
64+
```
65+
Matrix matrix = new Matrix(src);
66+
```
67+
68+
创建一个Matrix,并对src深拷贝(理解为新的matrix和src是两个对象,但内部数值相同即可)。
69+
70+
2771
### 基本方法
2872
2973
基本方法内容比较简单,在此处简要介绍一下。
@@ -38,6 +82,7 @@ toShortString | 将Matrix转换为短字符串<br/>`[1.0, 0.0, 0.0][0.0, 1.0, 0.
3882
3983
### 数值操作
4084
85+
4186
### 数值计算
4287
4388
### set pre 与 post

0 commit comments

Comments
 (0)