js-apis-matrix4.md 20.0 KB
Newer Older
E
ester.zhou 已提交
1
# @ohos.matrix4 (Matrix Transformation)
E
esterzhou 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

The **matrix4** module provides APIs for matrix transformation. You can use these APIs to translate, rotate, and scale images.

> **NOTE**
>
> The initial APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.


## Modules to Import

```ts
import matrix4 from '@ohos.matrix4'
```


## matrix4.init

E
ester.zhou 已提交
19
init(options: [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number]): Matrix4Transit
E
esterzhou 已提交
20 21


E
ester.zhou 已提交
22
Matrix constructor, which is used to create a 4 x 4 matrix by using the input parameter. Column-major order is used.
E
esterzhou 已提交
23 24 25 26 27

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

E
ester.zhou 已提交
28 29
| Name| Type                                                        | Mandatory| Description                                                        |
| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
E
ester.zhou 已提交
30
| option | [number,number,number,number,<br>number,number,number,number,<br>number,number,number,number,<br>number,number,number,number] | Yes  | A number array whose length is 16 (4 x 4). For details, see **4 x 4 matrix description**.<br>Default value:<br>[1, 0, 0, 0,<br>0, 1, 0, 0,<br>0, 0, 1, 0,<br>0, 0, 0, 1] |
E
esterzhou 已提交
31 32 33

**Return value**

E
ester.zhou 已提交
34 35 36
| Type                             | Description                        |
| --------------------------------- | ---------------------------- |
| [Matrix4Transit](#matrix4transit) | 4 x 4 matrix object created based on the input parameter.|
E
esterzhou 已提交
37

E
ester.zhou 已提交
38
**4 x 4 matrix description**
E
esterzhou 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93

| Name | Type    | Mandatory  | Description                  |
| ---- | ------ | ---- | -------------------- |
| m00  | number | Yes   | Scaling value of the x-axis. The default value is **1** for the identity matrix.     |
| m01  | number | Yes   | The second value, which is affected by the rotation of the x, y, and z axes.  |
| m02  | number | Yes   | The third value, which is affected by the rotation of the x, y, and z axes.  |
| m03  | number | Yes   | The fourth value, which is meaningless.              |
| m10  | number | Yes   | The fifth value, which is affected by the rotation of the x, y, and z axes.  |
| m11  | number | Yes   | Scaling value of the y-axis. The default value is **1** for the identity matrix.     |
| m12  | number | Yes   | The seventh value, which is affected by the rotation of the x, y, and z axes.  |
| m13  | number | Yes   | The eighth value, which is meaningless.              |
| m20  | number | Yes   | The ninth value, which is affected by the rotation of the x, y, and z axes.  |
| m21  | number | Yes   | The tenth value, which is affected by the rotation of the x, y, and z axes. |
| m22  | number | Yes   | Scaling value of the z-axis. The default value is **1** for the identity matrix.     |
| m23  | number | Yes   | Meaningless value.              |
| m30  | number | Yes   | Translation value of the x-axis, in px. The default value is **0** for the identity matrix.|
| m31  | number | Yes   | Translation value of the y-axis, in px. The default value is **0** for the identity matrix.|
| m32  | number | Yes   | Translation value of the z-axis, in px. The default value is **0** for the identity matrix.|
| m33  | number | Yes   | Valid in homogeneous coordinates, presenting the perspective projection effect.   |

**Example**

```ts
import matrix4 from '@ohos.matrix4'
// Create a 4 x 4 matrix.
let matrix = matrix4.init([1.0, 0.0, 0.0, 0.0,
                          0.0, 1.0, 0.0, 0.0,
                          0.0, 0.0, 1.0, 0.0,
                          0.0, 0.0, 0.0, 1.0])
@Entry
@Component
struct Tests {
  build() {
    Column() {
      Image($r("app.media.zh"))
        .width("40%")
        .height(100)
        .transform(matrix)
    }
  }
}
```


## matrix4.identity

identity(): Matrix4Transit


Constructs an identity matrix.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Return value**

E
ester.zhou 已提交
94 95 96
| Type                             | Description          |
| --------------------------------- | -------------- |
| [Matrix4Transit](#matrix4transit) | Identity matrix object.|
E
esterzhou 已提交
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138

**Example**

```ts
// The effect of matrix 1 is the same as that of matrix 2.
import matrix4 from '@ohos.matrix4'
let matrix1 = matrix4.init([1.0, 0.0, 0.0, 0.0,
                          0.0, 1.0, 0.0, 0.0,
                          0.0, 0.0, 1.0, 0.0,
                          0.0, 0.0, 0.0, 1.0])
let matrix2 = matrix4.identity()
@Entry
@Component
struct Tests {
  build() {
    Column() {
      Image($r("app.media.zh"))
        .width("40%")
        .height(100)
        .transform(matrix1)
      Image($r("app.media.zh"))
        .width("40%")
        .height(100)
        .margin({ top: 150 })
        .transform(matrix2)
    }
  }
}
```


## matrix4.copy

copy(): Matrix4Transit


Copies this matrix object.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Return value**

E
ester.zhou 已提交
139 140 141
| Type                             | Description                |
| --------------------------------- | -------------------- |
| [Matrix4Transit](#matrix4transit) | Copy object of the current matrix.|
E
esterzhou 已提交
142 143 144 145 146 147

**Example**

```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
E
ester.zhou 已提交
148

E
esterzhou 已提交
149 150 151
@Entry
@Component
struct Test {
E
ester.zhou 已提交
152
  private matrix1 = matrix4.identity().translate({ x: 100 })
E
ester.zhou 已提交
153
  // Perform the scale operation on the copy matrix of matrix1, which does not affect matrix1.
E
ester.zhou 已提交
154
  private matrix2 = this.matrix1.copy().scale({ x: 2 })
E
esterzhou 已提交
155 156 157 158 159 160 161 162 163 164

  build() {
    Column() {
      Image($r("app.media.bg1"))
        .width("40%")
        .height(100)
        .transform(this.matrix1)
      Image($r("app.media.bg2"))
        .width("40%")
        .height(100)
E
ester.zhou 已提交
165
        .margin({ top: 50 })
E
esterzhou 已提交
166 167 168 169 170 171 172 173
        .transform(this.matrix2)
    }
  }
}
```

![en-us_image_0000001219744181](figures/en-us_image_0000001219744181.png)

E
ester.zhou 已提交
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299
## matrix4.invert<sup>(deprecated)</sup>

invert(): Matrix4Transit

Inverts this matrix object.

This API is deprecated since API version 10.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Return value**

| Type                             | Description                  |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|

## matrix4.combine<sup>(deprecated)</sup>

combine(options: Matrix4Transit): Matrix4Transit

Combines the effects of two matrices to generate a new matrix object.

This API is deprecated since API version 10.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

| Name| Type                             | Mandatory| Description              |
| ------ | --------------------------------- | ---- | ------------------ |
| option | [Matrix4Transit](#matrix4transit) | Yes  | Matrix object to be combined.|

**Return value**

| Type                             | Description                  |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|

## matrix4.translate<sup>(deprecated)</sup>

translate(options: TranslateOption): Matrix4Transit

Translates this matrix object along the x, y, and z axes.

This API is deprecated since API version 10.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

| Name| Type                               | Mandatory| Description          |
| ------ | ----------------------------------- | ---- | -------------- |
| option | [TranslateOption](#translateoption) | Yes  | Translation configuration.|

**Return value**

| Type                             | Description                  |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|

## matrix4.scale<sup>(deprecated)</sup>

scale(options: ScaleOption): Matrix4Transit

Scales this matrix object along the x, y, and z axes.

This API is deprecated since API version 10.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

| Name| Type                       | Mandatory| Description          |
| ------ | --------------------------- | ---- | -------------- |
| option | [ScaleOption](#scaleoption) | Yes  | Scaling configuration.|

**Return value**

| Type                             | Description                  |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|

## matrix4.rotate<sup>(deprecated)</sup>

rotate(options: RotateOption): Matrix4Transit

Rotates this matrix object along the x, y, and z axes.

This API is deprecated since API version 10.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

| Name| Type                         | Mandatory| Description          |
| ------ | ----------------------------- | ---- | -------------- |
| option | [RotateOption](#rotateoption) | Yes  | Rotation configuration.|

**Return value**

| Type                             | Description                  |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|

## matrix4.transformPoint<sup>(deprecated)</sup>

transformPoint(options: [number, number]): [number, number]

Applies the current transformation effect to a coordinate point.

This API is deprecated since API version 10.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

| Name| Type            | Mandatory| Description              |
| ------ | ---------------- | ---- | ------------------ |
| option | [number, number] | Yes  | Point to be transformed.|

**Return value**

| Type            | Description                       |
| ---------------- | --------------------------- |
| [number, number] | Point object after matrix transformation|

E
esterzhou 已提交
300

E
ester.zhou 已提交
301
## Matrix4Transit
E
esterzhou 已提交
302 303 304 305


### combine

E
ester.zhou 已提交
306
combine(options: Matrix4Transit): Matrix4Transit
E
esterzhou 已提交
307 308


E
ester.zhou 已提交
309
Combines the effects of two matrices to generate a new matrix object. The original matrix that calls this API will be changed.
E
esterzhou 已提交
310 311 312 313 314

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

E
ester.zhou 已提交
315 316 317
| Name| Type                             | Mandatory| Description              |
| ------ | --------------------------------- | ---- | ------------------ |
| option | [Matrix4Transit](#matrix4transit) | Yes  | Matrix object to be combined.|
E
esterzhou 已提交
318 319 320

**Return value**

E
ester.zhou 已提交
321 322 323
| Type                             | Description              |
| --------------------------------- | ------------------ |
| [Matrix4Transit](#matrix4transit) | Object after matrix combination.|
E
esterzhou 已提交
324 325 326 327 328 329

**Example**

```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
E
ester.zhou 已提交
330

E
esterzhou 已提交
331 332 333
@Entry
@Component
struct Test {
E
ester.zhou 已提交
334 335
  private matrix1 = matrix4.identity().translate({ x: 200 })
  private matrix2 = matrix4.identity().scale({ x: 2 })
E
esterzhou 已提交
336 337 338 339 340 341 342

  build() {
    Column() {
      // Before matrix transformation
      Image($r("app.media.icon"))
        .width("40%")
        .height(100)
E
ester.zhou 已提交
343
        .margin({ top: 50 })
E
esterzhou 已提交
344 345
      // Translate the x-axis by 200px, and then scale it twice to obtain the resultant matrix.
      Image($r("app.media.icon"))
E
ester.zhou 已提交
346
        .transform(this.matrix1.copy().combine(this.matrix2))
E
esterzhou 已提交
347
        .width("40%")
E
ester.zhou 已提交
348 349
        .height(100)
        .margin({ top: 50 })
E
esterzhou 已提交
350 351 352 353 354 355 356 357 358 359 360 361
    }
  }
}
```

![en-us_image_0000001118642902](figures/en-us_image_0000001118642902.png)


### invert

invert(): Matrix4Transit

E
ester.zhou 已提交
362
Inverts this matrix object. The original matrix that calls this API will be changed.
E
esterzhou 已提交
363 364 365 366 367

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Return value**

E
ester.zhou 已提交
368 369 370
| Type                             | Description                  |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|
E
esterzhou 已提交
371 372 373 374 375 376

**Example**

```ts
import matrix4 from '@ohos.matrix4'
// The effect of matrix 1 (width scaled up by 2x) is opposite to that of matrix 2 (width scaled down by 2x).
E
ester.zhou 已提交
377
let matrix1 = matrix4.identity().scale({ x: 2 })
E
ester.zhou 已提交
378
let matrix2 = matrix1.copy().invert()
E
ester.zhou 已提交
379

E
esterzhou 已提交
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
@Entry
@Component
struct Tests {
  build() {
    Column() {
      Image($r("app.media.zh"))
        .width(200)
        .height(100)
        .transform(matrix1)
        .margin({ top: 100 })
      Image($r("app.media.zh"))
        .width(200)
        .height(100)
        .margin({ top: 150 })
        .transform(matrix2)
    }
  }
}
```


### translate

E
ester.zhou 已提交
403
translate(options: TranslateOption): Matrix4Transit
E
esterzhou 已提交
404

E
ester.zhou 已提交
405
Translates this matrix object along the x, y, and z axes. The original matrix that calls this API will be changed.
E
esterzhou 已提交
406 407 408 409 410

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

E
ester.zhou 已提交
411 412 413
| Name| Type                               | Mandatory| Description          |
| ------ | ----------------------------------- | ---- | -------------- |
| option | [TranslateOption](#translateoption) | Yes  | Translation configuration.|
E
esterzhou 已提交
414 415 416

**Return value**

E
ester.zhou 已提交
417 418 419
| Type                             | Description                        |
| --------------------------------- | ---------------------------- |
| [Matrix4Transit](#matrix4transit) | Matrix object after the translation.|
E
esterzhou 已提交
420 421 422 423 424 425

**Example**

```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
E
ester.zhou 已提交
426

E
esterzhou 已提交
427 428 429
@Entry
@Component
struct Test {
E
ester.zhou 已提交
430
  private matrix1 = matrix4.identity().translate({ x: 100, y: 200, z: 30 })
E
esterzhou 已提交
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446

  build() {
    Column() {
      Image($r("app.media.bg1")).transform(this.matrix1)
        .width("40%")
        .height(100)
    }
  }
}
```

![en-us_image_0000001219662645](figures/en-us_image_0000001219662645.png)


### scale

E
ester.zhou 已提交
447
scale(options: ScaleOption): Matrix4Transit
E
esterzhou 已提交
448 449


E
ester.zhou 已提交
450
Scales this matrix object along the x, y, and z axes. The original matrix that calls this API will be changed.
E
esterzhou 已提交
451 452 453 454 455

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

E
ester.zhou 已提交
456 457 458 459
| Name| Type                       | Mandatory| Description          |
| ------ | --------------------------- | ---- | -------------- |
| option | [ScaleOption](#scaleoption) | Yes  | Scaling configuration.|

E
esterzhou 已提交
460 461
**Return value**

E
ester.zhou 已提交
462 463 464
| Type                             | Description                        |
| --------------------------------- | ---------------------------- |
| [Matrix4Transit](#matrix4transit) | Matrix object after the scaling.|
E
esterzhou 已提交
465 466 467 468 469 470 471 472 473

**Example**

```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
E
ester.zhou 已提交
474
  private matrix1 = matrix4.identity().scale({ x:2, y:3, z:4, centerX:50, centerY:50 })
E
esterzhou 已提交
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490

  build() {
    Column() { 
      Image($r("app.media.bg1")).transform(this.matrix1)
        .width("40%")
        .height(100)
    }
  }
}
```

![en-us_image_0000001219864131](figures/en-us_image_0000001219864131.png)


### rotate

E
ester.zhou 已提交
491
rotate(options: RotateOption): Matrix4Transit
E
esterzhou 已提交
492 493


E
ester.zhou 已提交
494
Rotates this matrix object along the x, y, and z axes. The original matrix that calls this API will be changed.
E
esterzhou 已提交
495 496 497 498 499

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

E
ester.zhou 已提交
500 501 502 503
| Name| Type                         | Mandatory| Description          |
| ------ | ----------------------------- | ---- | -------------- |
| option | [RotateOption](#rotateoption) | Yes  | Rotation configuration.|

E
esterzhou 已提交
504 505
**Return value**

E
ester.zhou 已提交
506 507 508
| Type                             | Description                        |
| --------------------------------- | ---------------------------- |
| [Matrix4Transit](#matrix4transit) | Matrix object after the rotation.|
E
esterzhou 已提交
509 510 511 512 513 514

**Example**

```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
E
ester.zhou 已提交
515

E
esterzhou 已提交
516 517 518
@Entry
@Component
struct Test {
E
ester.zhou 已提交
519
  private matrix1 = matrix4.identity().rotate({ x: 1, y: 1, z: 2, angle: 30 })
E
esterzhou 已提交
520 521 522 523 524 525

  build() {
    Column() {
      Image($r("app.media.bg1")).transform(this.matrix1)
        .width("40%")
        .height(100)
E
ester.zhou 已提交
526
    }.width("100%").margin({ top: 50 })
E
esterzhou 已提交
527 528 529 530 531 532 533 534 535
  }
}
```

![en-us_image_0000001174422898](figures/en-us_image_0000001174422898.png)


### transformPoint

E
ester.zhou 已提交
536
transformPoint(options: [number, number]): [number, number]
E
esterzhou 已提交
537 538 539 540 541 542 543 544


Applies the current transformation effect to a coordinate point.

**System capability**: SystemCapability.ArkUI.ArkUI.Full

**Parameters**

E
ester.zhou 已提交
545 546 547
| Name| Type            | Mandatory| Description              |
| ------ | ---------------- | ---- | ------------------ |
| option | [number, number] | Yes  | Point to be transformed.|
E
esterzhou 已提交
548 549 550

**Return value**

E
ester.zhou 已提交
551 552 553
| Type            | Description                       |
| ---------------- | --------------------------- |
| [number, number] | Point object after matrix transformation|
E
esterzhou 已提交
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576

**Example**

```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'

@Entry
@Component
struct Test {
  private originPoint: [number, number] = [50, 50]
  private matrix_1 = matrix4.identity().translate({ x: 150, y: -50 })
  private transformPoint = this.matrix_1.transformPoint(this.originPoint)
  private matrix_2 = matrix4.identity().translate({ x: this.transformPoint[0], y: this.transformPoint[1] })

  build() {
    Column() {
      Text(`Coordinates before matrix transformation: [${this.originPoint}]`)
        .fontSize(16)
      Image($r("app.media.image"))
        .width('600px')
        .height('300px')
        .margin({ top: 50 })
E
ester.zhou 已提交
577
      Text(`Coordinates after matrix transformation: [${this.transformPoint}]`)
E
esterzhou 已提交
578 579 580 581 582 583 584 585 586 587 588 589 590
        .fontSize(16)
        .margin({ top: 100 })
      Image($r("app.media.image"))
        .width('600px')
        .height('300px')
        .margin({ top: 50 })
        .transform(this.matrix_2)
    }.width("100%").padding(50)
  }
}
```

![en-us_image_0000001219864133](figures/en-us_image_0000001219864133.PNG)
E
ester.zhou 已提交
591 592 593

## TranslateOption

E
ester.zhou 已提交
594 595
**System capability**: SystemCapability.ArkUI.ArkUI.Full

E
ester.zhou 已提交
596
| Name| Type  | Mandatory| Description                                                       |
E
ester.zhou 已提交
597 598 599 600
| ---- | ------ | ---- | ----------------------------------------------------------- |
| x    | number | No  | Translation distance along the x-axis, in px.<br>Default value: **0**<br>Value range: (-∞, +∞)|
| y    | number | No  | Translation distance along the y-axis, in px.<br>Default value: **0**<br>Value range: (-∞, +∞)|
| z    | number | No  | Translation distance along the z-axis, in px.<br>Default value: **0**<br>Value range: (-∞, +∞)|
E
ester.zhou 已提交
601 602 603

## ScaleOption

E
ester.zhou 已提交
604 605 606
**System capability**: SystemCapability.ArkUI.ArkUI.Full

| Name   | Type  | Mandatory| Description                                                        |
E
ester.zhou 已提交
607
| ------- | ------ | ---- | ------------------------------------------------------------ |
E
ester.zhou 已提交
608 609 610
| x       | number | No  | Scaling multiple along the x-axis. x > 1: The image is scaled up along the x-axis.<br>0 < x < 1: The image is scaled down along the x-axis.<br>x < 0: The image is scaled in the reverse direction of the x-axis.<br>Default value: **1**<br>Value range: (-∞, +∞)|
| y       | number | No  | Scaling multiple along the y-axis. y > 1: The image is scaled up along the y-axis.<br>0 < y < 1: The image is scaled down along the y-axis.<br>y < 0: The image is scaled in the reverse direction of the y-axis.<br>Default value: **1**<br>Value range: (-∞, +∞)|
| z       | number | No  | Scaling multiple along the z-axis. z > 1: The image is scaled up along the z-axis.<br>0 < z < 1: The image is scaled down along the z-axis.<br>z < 0: The image is scaled in the reverse direction of the z-axis.<br>Default value: **1**<br>Value range: (-∞, +∞)|
E
ester.zhou 已提交
611 612 613 614 615
| centerX | number | No  | X coordinate of the center point.<br>Default value: **0**<br>Value range: (-∞, +∞)   |
| centerY | number | No  | Y coordinate of the center point.<br>Default value: **0**<br>Value range: (-∞, +∞)   |

## RotateOption

E
ester.zhou 已提交
616 617 618
**System capability**: SystemCapability.ArkUI.ArkUI.Full

| Name   | Type  | Mandatory| Description                                                   |
E
ester.zhou 已提交
619
| ------- | ------ | ---- | ------------------------------------------------------- |
E
ester.zhou 已提交
620 621 622
| x       | number | No  | X coordinate of the rotation axis vector.<br>Default value: **0**<br>Value range: (-∞, +∞)|
| y       | number | No  | Y coordinate of the rotation axis vector.<br>Default value: **0**<br>Value range: (-∞, +∞)|
| z       | number | No  | Z coordinate of the rotation axis vector.<br>Default value: **0**<br>Value range: (-∞, +∞)<br>**NOTE**<br>The rotation axis vector is valid only when at least one of **x**, **y**, and **z** is not 0.|
E
ester.zhou 已提交
623 624 625
| angle   | number | No  | Rotation angle.<br>Default value: **0**                               |
| centerX | number | No  | X coordinate of the center point.<br>Default value: **0**                      |
| centerY | number | No  | Y coordinate of the center point.<br>Default value: **0**                      |