1# @ohos.matrix4 (Matrix Transformation) 2 3The **matrix4** module provides APIs for matrix transformation. You can use these APIs to translate, rotate, and scale images. 4 5> **NOTE** 6> 7> 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. 8 9 10## Modules to Import 11 12```ts 13import { matrix4 } from '@kit.ArkUI'; 14``` 15 16 17## matrix4.init 18 19init(options: [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number]): Matrix4Transit 20 21Matrix constructor, which is used to create a 4 x 4 matrix with the input parameters. Column-major order is used. 22 23**Atomic service API**: This API can be used in atomic services since API version 11. 24 25**System capability**: SystemCapability.ArkUI.ArkUI.Full 26 27**Parameters** 28 29| Name | Type | Mandatory | Description | 30| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 31| options | [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] | 32 33**Return value** 34 35| Type | Description | 36| --------------------------------- | ---------------------------- | 37| [Matrix4Transit](#matrix4transit) | 4 x 4 matrix object created based on the input parameters. | 38 39**4 x 4 matrix description** 40 41| Name | Type | Mandatory | Description | 42| ---- | ------ | ---- | -------------------- | 43| m00 | number | Yes | Scaling value of the x-axis. The default value is **1** for the identity matrix. | 44| m01 | number | Yes | The second value, which is affected by the rotation or tilt of the x, y, and z axes. | 45| m02 | number | Yes | The third value, which is affected by the rotation of the x, y, and z axes. | 46| m03 | number | Yes | The fourth value, which is affected by perspective projection. | 47| m10 | number | Yes | The fifth value, which is affected by the rotation or tilt of the x, y, and z axes. | 48| m11 | number | Yes | Scaling value of the y-axis. The default value is **1** for the identity matrix. | 49| m12 | number | Yes | The seventh value, which is affected by the rotation of the x, y, and z axes. | 50| m13 | number | Yes | The eighth value, which is affected by perspective projection. | 51| m20 | number | Yes | The ninth value, which is affected by the rotation of the x, y, and z axes. | 52| m21 | number | Yes | The tenth value, which is affected by the rotation of the x, y, and z axes. | 53| m22 | number | Yes | Scaling value of the z-axis. The default value is **1** for the identity matrix. | 54| m23 | number | Yes | The 12th value, which is affected by perspective projection. | 55| m30 | number | Yes | Translation value of the x-axis, in px. The default value is **0** for the identity matrix. | 56| m31 | number | Yes | Translation value of the y-axis, in px. The default value is **0** for the identity matrix. | 57| m32 | number | Yes | Translation value of the z-axis, in px. The default value is **0** for the identity matrix. | 58| m33 | number | Yes | Valid in homogeneous coordinates, presenting the perspective projection effect. | 59 60**Example** 61 62```ts 63import { matrix4 } from '@kit.ArkUI'; 64// Create a 4 x 4 matrix. 65let matrix = matrix4.init([1.0, 0.0, 0.0, 0.0, 66 0.0, 1.0, 0.0, 0.0, 67 0.0, 0.0, 1.0, 0.0, 68 0.0, 0.0, 0.0, 1.0]) 69@Entry 70@Component 71struct Tests { 72 build() { 73 Column() { 74 Image($r("app.media.zh")) 75 .width("40%") 76 .height(100) 77 .transform(matrix) 78 } 79 } 80} 81``` 82 83 84## matrix4.identity 85 86identity(): Matrix4Transit 87 88Constructs an identity matrix. 89 90**Atomic service API**: This API can be used in atomic services since API version 11. 91 92**System capability**: SystemCapability.ArkUI.ArkUI.Full 93 94**Return value** 95 96| Type | Description | 97| --------------------------------- | -------------- | 98| [Matrix4Transit](#matrix4transit) | Identity matrix object. | 99 100**Example** 101 102```ts 103// The effect of matrix 1 is the same as that of matrix 2. 104import { matrix4 } from '@kit.ArkUI'; 105let matrix1 = matrix4.init([1.0, 0.0, 0.0, 0.0, 106 0.0, 1.0, 0.0, 0.0, 107 0.0, 0.0, 1.0, 0.0, 108 0.0, 0.0, 0.0, 1.0]) 109let matrix2 = matrix4.identity() 110@Entry 111@Component 112struct Tests { 113 build() { 114 Column() { 115 Image($r("app.media.zh")) 116 .width("40%") 117 .height(100) 118 .transform(matrix1) 119 Image($r("app.media.zh")) 120 .width("40%") 121 .height(100) 122 .margin({ top: 150 }) 123 .transform(matrix2) 124 } 125 } 126} 127``` 128 129## Matrix4Transit 130 131Implements a **Matrix4Transit** object. 132 133**Atomic service API**: This API can be used in atomic services since API version 11. 134 135**System capability**: SystemCapability.ArkUI.ArkUI.Full 136 137### copy 138 139copy(): Matrix4Transit 140 141Copies this matrix object. 142 143**Atomic service API**: This API can be used in atomic services since API version 11. 144 145**System capability**: SystemCapability.ArkUI.ArkUI.Full 146 147**Return value** 148 149| Type | Description | 150| --------------------------------- | -------------------- | 151| [Matrix4Transit](#matrix4transit) | Copy object of the current matrix. | 152 153 154**Example** 155 156```ts 157// xxx.ets 158import { matrix4 } from '@kit.ArkUI'; 159 160@Entry 161@Component 162struct Test { 163 private matrix1 = matrix4.identity().scale({ x: 1.5 }) 164 private matrix2 = this.matrix1.copy().translate({ x: 200 }) 165 imageSize:Length = '300px' 166 build() { 167 Column({space:"50px"}) { 168 Image($r("app.media.testImage")) 169 .width(this.imageSize) 170 .height(this.imageSize) 171 Image($r("app.media.testImage")) 172 .width(this.imageSize) 173 .height(this.imageSize) 174 .transform(this.matrix1) 175 Image($r("app.media.testImage")) 176 .width(this.imageSize) 177 .height(this.imageSize) 178 .transform(this.matrix2) 179 }.alignItems(HorizontalAlign.Center) 180 .height('100%').width("100%") 181 .justifyContent(FlexAlign.Center) 182 } 183} 184 185``` 186 187 188### combine 189 190combine(options: Matrix4Transit): Matrix4Transit 191 192Combines the effects of two matrices to generate a new matrix object. The original matrix that calls this API will be changed. 193 194**Atomic service API**: This API can be used in atomic services since API version 11. 195 196**System capability**: SystemCapability.ArkUI.ArkUI.Full 197 198**Parameters** 199 200| Name | Type | Mandatory | Description | 201| ------ | --------------------------------- | ---- | ------------------ | 202| options | [Matrix4Transit](#matrix4transit) | Yes | Matrix object to be combined. | 203 204**Return value** 205 206| Type | Description | 207| --------------------------------- | ------------------ | 208| [Matrix4Transit](#matrix4transit) | Object after matrix combination. | 209 210**Example** 211 212```ts 213// xxx.ets 214import { matrix4 } from '@kit.ArkUI'; 215 216@Entry 217@Component 218struct Test { 219 private matrix1 = matrix4.identity().translate({ x: 200 }) 220 private matrix2 = matrix4.identity().scale({ x: 2 }) 221 222 build() { 223 Column() { 224 // Before matrix transformation 225 Image($r("app.media.icon")) 226 .width("40%") 227 .height(100) 228 .margin({ top: 50 }) 229 // Translate the x-axis by 200px, and then scale it twice to obtain the resultant matrix. 230 Image($r("app.media.icon")) 231 .transform(this.matrix1.copy().combine(this.matrix2)) 232 .width("40%") 233 .height(100) 234 .margin({ top: 50 }) 235 } 236 } 237} 238``` 239 240 241 242 243### invert 244 245invert(): Matrix4Transit 246 247Inverts this matrix object. The original matrix that calls this API will be changed. 248 249**Atomic service API**: This API can be used in atomic services since API version 11. 250 251**System capability**: SystemCapability.ArkUI.ArkUI.Full 252 253**Return value** 254 255| Type | Description | 256| --------------------------------- | ---------------------- | 257| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix. | 258 259**Example** 260 261```ts 262import { matrix4 } from '@kit.ArkUI'; 263// The effect of matrix 1 (width scaled up by 2x) is opposite to that of matrix 2 (width scaled down by 2x). 264let matrix1 = matrix4.identity().scale({ x: 2 }) 265let matrix2 = matrix1.copy().invert() 266 267@Entry 268@Component 269struct Tests { 270 build() { 271 Column() { 272 Image($r("app.media.zh")) 273 .width(200) 274 .height(100) 275 .transform(matrix1) 276 .margin({ top: 100 }) 277 Image($r("app.media.zh")) 278 .width(200) 279 .height(100) 280 .margin({ top: 150 }) 281 .transform(matrix2) 282 } 283 } 284} 285``` 286 287 288### translate 289 290translate(options: TranslateOption): Matrix4Transit 291 292Translates this matrix object along the x, y, and z axes. The original matrix that calls this API will be changed. 293 294**Atomic service API**: This API can be used in atomic services since API version 11. 295 296**System capability**: SystemCapability.ArkUI.ArkUI.Full 297 298**Parameters** 299 300| Name | Type | Mandatory | Description | 301| ------ | ----------------------------------- | ---- | -------------- | 302| options | [TranslateOption](#translateoption) | Yes | Translation configuration. | 303 304**Return value** 305 306| Type | Description | 307| --------------------------------- | ---------------------------- | 308| [Matrix4Transit](#matrix4transit) | Matrix object after the translation. | 309 310**Example** 311 312```ts 313// xxx.ets 314import { matrix4 } from '@kit.ArkUI'; 315 316@Entry 317@Component 318struct Test { 319 private matrix1 = matrix4.identity().translate({ x: 100, y: 200, z: 30 }) 320 321 build() { 322 Column() { 323 Image($r("app.media.bg1")).transform(this.matrix1) 324 .width("40%") 325 .height(100) 326 } 327 } 328} 329``` 330 331 332 333 334### scale 335 336scale(options: ScaleOption): Matrix4Transit 337 338Scales this matrix object along the x, y, and z axes. The matrix that calls this API will be changed. 339 340**Atomic service API**: This API can be used in atomic services since API version 11. 341 342**System capability**: SystemCapability.ArkUI.ArkUI.Full 343 344**Parameters** 345 346| Name | Type | Mandatory | Description | 347| ------ | --------------------------- | ---- | -------------- | 348| options | [ScaleOption](#scaleoption) | Yes | Scaling configuration. | 349 350**Return value** 351 352| Type | Description | 353| --------------------------------- | ---------------------------- | 354| [Matrix4Transit](#matrix4transit) | Matrix object after the scaling. | 355 356**Example** 357 358```ts 359// xxx.ets 360import { matrix4 } from '@kit.ArkUI'; 361 362@Entry 363@Component 364struct Test { 365 private matrix1 = matrix4.identity() 366 .scale({ x: 2, y: 3, z: 4, centerX: 50, centerY: 50 }) 367 368 build() { 369 Column() { 370 Image($r("app.media.testImage")).transform(this.matrix1) 371 .width("300px") 372 .height("300px") 373 }.width("100%").height("100%").justifyContent(FlexAlign.Center) 374 } 375} 376``` 377 378 379 380 381### skew<sup>12+</sup> 382 383skew(x: number, y: number): Matrix4Transit 384 385Skews this matrix object along the x and y axes. The matrix that calls this API will be changed. 386 387**Atomic service API**: This API can be used in atomic services since API version 12. 388 389**System capability**: SystemCapability.ArkUI.ArkUI.Full 390 391**Parameters** 392 393| Name | Type | Mandatory | Description | 394| ------ | --------------------------- | ---- | -------------- | 395| x | number | Yes | Amount of skewing on the x-axis. | 396| y | number | Yes | Amount of skewing on the y-axis. | 397 398**Return value** 399 400| Type | Description | 401| --------------------------------- | ---------------------------- | 402| [Matrix4Transit](#matrix4transit) | Matrix object after the skewing. | 403 404**Example** 405 406```ts 407// xxx.ets 408import { matrix4 } from '@kit.ArkUI'; 409@Entry 410@Component 411struct Test { 412 private matrix1 = matrix4.identity().skew(2, 3) 413 414 build() { 415 Column() { 416 Image($r("app.media.bg1")).transform(this.matrix1) 417 .height(100) 418 .margin({ 419 top: 300 420 }) 421 } 422 .width("100%") 423 .height("100%") 424 } 425} 426``` 427 428 429 430 431### rotate 432 433rotate(options: RotateOption): Matrix4Transit 434 435Rotates this matrix object along the x, y, and z axes. The matrix that calls this API will be changed. 436 437**Atomic service API**: This API can be used in atomic services since API version 11. 438 439**System capability**: SystemCapability.ArkUI.ArkUI.Full 440 441**Parameters** 442 443| Name | Type | Mandatory | Description | 444| ------ | ----------------------------- | ---- | -------------- | 445| options | [RotateOption](#rotateoption) | Yes | Rotation configuration. | 446 447**Return value** 448 449| Type | Description | 450| --------------------------------- | ---------------------------- | 451| [Matrix4Transit](#matrix4transit) | Matrix object after the rotation. | 452 453**Example** 454 455```ts 456// xxx.ets 457import { matrix4 } from '@kit.ArkUI'; 458 459@Entry 460@Component 461struct Test { 462 private matrix1 = matrix4.identity().rotate({ x: 1, y: 1, z: 2, angle: 30 }) 463 464 build() { 465 Column() { 466 Image($r("app.media.bg1")).transform(this.matrix1) 467 .width("40%") 468 .height(100) 469 }.width("100%").margin({ top: 50 }) 470 } 471} 472``` 473 474 475 476 477### transformPoint 478 479transformPoint(options: [number, number]): [number, number] 480 481Applies the current transformation effect to a coordinate point. 482 483**Atomic service API**: This API can be used in atomic services since API version 11. 484 485**System capability**: SystemCapability.ArkUI.ArkUI.Full 486 487**Parameters** 488 489| Name | Type | Mandatory | Description | 490| ------- | ---------------- | ---- | ------------------ | 491| options | [number, number] | Yes | Point to be transformed. | 492 493**Return value** 494 495| Type | Description | 496| ---------------- | --------------------------- | 497| [number, number] | Point object after matrix transformation | 498 499**Example** 500 501```ts 502// xxx.ets 503import { matrix4 } from '@kit.ArkUI'; 504 505@Entry 506@Component 507struct Test { 508 private originPoint: number[] = [50, 50] 509 private matrix_1 = matrix4.identity().translate({ x: 150, y: -50 }) 510 private transformPoint = this.matrix_1.transformPoint([this.originPoint[0], this.originPoint[1]]) 511 private matrix_2 = matrix4.identity().translate({ x: this.transformPoint[0], y: this.transformPoint[1] }) 512 513 build() { 514 Column() { 515 Text(`Coordinates before matrix transformation: [${this.originPoint}]`) 516 .fontSize(16) 517 Image($r("app.media.image")) 518 .width('600px') 519 .height('300px') 520 .margin({ top: 50 }) 521 Text(`Coordinates after matrix transformation: [${this.transformPoint}]`) 522 .fontSize(16) 523 .margin({ top: 100 }) 524 Image($r("app.media.image")) 525 .width('600px') 526 .height('300px') 527 .margin({ top: 50 }) 528 .transform(this.matrix_2) 529 }.width("100%").padding(50) 530 } 531} 532``` 533 534 535 536### setPolyToPoly<sup>12+</sup> 537 538setPolyToPoly(options: PolyToPolyOptions): Matrix4Transit 539 540Maps the vertex coordinates of a polygon to those of another polygon. 541 542**Atomic service API**: This API can be used in atomic services since API version 12. 543 544**System capability**: SystemCapability.ArkUI.ArkUI.Full 545 546**Parameters** 547 548| Name | Type | Mandatory | Description | 549| ------ | ---------------- | ---- | ------------------ | 550| options | [PolyToPolyOptions](#polytopolyoptions12) | Yes | Parameters for mapping. | 551 552**Return value** 553 554| Type | Description | 555| --------------------------------- | -------------------- | 556| [Matrix4Transit](#matrix4transit) | Matrix object after the mapping. | 557 558> **NOTE** 559> 560> This API must be used with **scale({centerX:0,centerY:0,x:1})** to ensure that the transformation is centered at the upper left corner of the component. 561 562**Example** 563 564```ts 565import { matrix4 } from '@kit.ArkUI' 566 567@Entry 568@Component 569struct Index { 570 private matrix1 = matrix4.identity().setPolyToPoly({ src: [{x:0, y:0}, {x:500, y:0}, {x:0, y:500}, {x:500, y:500} ], 571 dst:[{x:0, y:0}, {x:500, y:0}, {x:0, y:500}, {x:750, y:1000} ], pointCount:4}) 572 573 build() { 574 Stack() { 575 Column().backgroundColor(Color.Blue) 576 .width('500px') 577 .height('500px') 578 Image($r('app.media.transition_image1')) 579 .scale({centerX:0,centerY:0,x:1}) 580 .transform(this.matrix1) 581 .width('500px') 582 .height('500px') 583 }.width("100%").height("100%").opacity(0.5) 584 } 585} 586``` 587 588## TranslateOption 589 590**Atomic service API**: This API can be used in atomic services since API version 11. 591 592**System capability**: SystemCapability.ArkUI.ArkUI.Full 593 594| Name | Type | Mandatory | Description | 595| ---- | ------ | ---- | ----------------------------------------------------------- | 596| x | number | No | Translation distance along the x-axis, in px.<br>Default value: **0**<br>Value range: (-∞, +∞) | 597| y | number | No | Translation distance along the y-axis, in px.<br>Default value: **0**<br>Value range: (-∞, +∞) | 598| z | number | No | Translation distance along the z-axis, in px.<br>Default value: **0**<br>Value range: (-∞, +∞) | 599 600## ScaleOption 601 602**Atomic service API**: This API can be used in atomic services since API version 11. 603 604**System capability**: SystemCapability.ArkUI.ArkUI.Full 605 606| Name | Type | Mandatory | Description | 607| ------- | ------ | ---- | ------------------------------------------------------------ | 608| 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: (-∞, +∞) | 609| 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: (-∞, +∞) | 610| 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: (-∞, +∞) | 611| centerX | number | No | X coordinate of the center point.<br>Default value: X-coordinate of the component center<br>Value range: (-∞, +∞) | 612| centerY | number | No | Y coordinate of the center point.<br>Default value: Y-coordinate of the component center<br>Value range: (-∞, +∞) | 613 614## RotateOption 615 616**Atomic service API**: This API can be used in atomic services since API version 11. 617 618**System capability**: SystemCapability.ArkUI.ArkUI.Full 619 620| Name | Type | Mandatory | Description | 621| ------- | ------ | ---- | ------------------------------------------------------- | 622| x | number | No | X coordinate of the rotation axis vector.<br>Default value: **0**<br>Value range: (-∞, +∞) | 623| y | number | No | Y coordinate of the rotation axis vector.<br>Default value: **0**<br>Value range: (-∞, +∞) | 624| 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. | 625| angle | number | No | Rotation angle.<br>Default value: **0** | 626| centerX | number | No | X coordinate of the center point.<br>Default value: X-coordinate of the component center | 627| centerY | number | No | Y coordinate of the center point.<br>Default value: Y-coordinate of the component center | 628 629## PolyToPolyOptions<sup>12+</sup> 630 631**Atomic service API**: This API can be used in atomic services since API version 12. 632 633**System capability**: SystemCapability.ArkUI.ArkUI.Full 634 635| Name | Type | Mandatory | Description | 636| ---- | ------ | ---- | ----------------------------------------------------------- | 637| src | Array<[Point](#point12)> | Yes | Coordinates of the source point. | 638| srcIndex | number | No | Start index of the source point coordinates.<br>Default value: **0**| 639| dst | Array<[Point](#point12)> | Yes | Coordinates of the destination point. | 640| dstIndex | number | No | Start index of the destination point coordinates.<br>Default value: **0** | 641| pointCount | number | No | Number of used points.<br>Default value: **src.length/2**| 642 643## Point<sup>12+</sup> 644 645**Atomic service API**: This API can be used in atomic services since API version 12. 646 647**System capability**: SystemCapability.ArkUI.ArkUI.Full 648 649| Name | Type | Mandatory | Description | 650| ---- | ------ | ---- | ----------------------------------------------------------- | 651| x | number | Yes | X-coordinate. | 652| y | number | Yes | Y-coordinate. | 653 654## matrix4.copy<sup>(deprecated)</sup> 655 656copy(): Matrix4Transit 657 658 659Copies this matrix object. 660 661> **NOTE** 662> 663> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.copy](#copy) instead. 664 665 666**System capability**: SystemCapability.ArkUI.ArkUI.Full 667 668**Return value** 669 670| Type | Description | 671| --------------------------------- | -------------------- | 672| [Matrix4Transit](#matrix4transit) | Copy object of the current matrix. | 673 674**Example** 675 676```ts 677// xxx.ets 678import { matrix4 } from '@kit.ArkUI'; 679 680@Entry 681@Component 682struct Test { 683 private matrix1 = matrix4.identity().translate({ x: 100 }) 684 // Perform the scale operation on the copy matrix of matrix1, which does not affect matrix1. 685 private matrix2 = this.matrix1.copy().scale({ x: 2 }) 686 687 build() { 688 Column() { 689 Image($r("app.media.bg1")) 690 .width("40%") 691 .height(100) 692 .transform(this.matrix1) 693 Image($r("app.media.bg2")) 694 .width("40%") 695 .height(100) 696 .margin({ top: 50 }) 697 .transform(this.matrix2) 698 } 699 } 700} 701``` 702 703 704 705## matrix4.invert<sup>(deprecated)</sup> 706 707invert(): Matrix4Transit 708 709Inverts this matrix object. 710 711> **NOTE** 712> 713> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.invert](#invert) instead. 714 715**System capability**: SystemCapability.ArkUI.ArkUI.Full 716 717**Return value** 718 719| Type | Description | 720| --------------------------------- | ---------------------- | 721| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix. | 722 723## matrix4.combine<sup>(deprecated)</sup> 724 725combine(options: Matrix4Transit): Matrix4Transit 726 727Combines the effects of two matrices to generate a new matrix object. 728 729> **NOTE** 730> 731> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.combine](#combine) instead. 732 733**System capability**: SystemCapability.ArkUI.ArkUI.Full 734 735**Parameters** 736 737| Name | Type | Mandatory | Description | 738| ------- | --------------------------------- | ---- | ------------------ | 739| options | [Matrix4Transit](#matrix4transit) | Yes | Matrix object to be combined. | 740 741**Return value** 742 743| Type | Description | 744| --------------------------------- | ---------------------- | 745| [Matrix4Transit](#matrix4transit) | Matrix object after combination. | 746 747## matrix4.translate<sup>(deprecated)</sup> 748 749translate(options: TranslateOption): Matrix4Transit 750 751Translates this matrix object along the x, y, and z axes. 752 753> **NOTE** 754> 755> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.translate](#translate) instead. 756 757**System capability**: SystemCapability.ArkUI.ArkUI.Full 758 759**Parameters** 760 761| Name | Type | Mandatory | Description | 762| ------- | ----------------------------------- | ---- | -------------- | 763| options | [TranslateOption](#translateoption) | Yes | Translation configuration. | 764 765**Return value** 766 767| Type | Description | 768| --------------------------------- | ---------------------- | 769| [Matrix4Transit](#matrix4transit) | Matrix object after translation. | 770 771## matrix4.scale<sup>(deprecated)</sup> 772 773scale(options: ScaleOption): Matrix4Transit 774 775Scales this matrix object along the x, y, and z axes. 776 777> **NOTE** 778> 779> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.scale](#scale) instead. 780 781**System capability**: SystemCapability.ArkUI.ArkUI.Full 782 783**Parameters** 784 785| Name | Type | Mandatory | Description | 786| ------- | --------------------------- | ---- | -------------- | 787| options | [ScaleOption](#scaleoption) | Yes | Scaling configuration. | 788 789**Return value** 790 791| Type | Description | 792| --------------------------------- | ---------------------- | 793| [Matrix4Transit](#matrix4transit) | Matrix object after scaling. | 794 795## matrix4.rotate<sup>(deprecated)</sup> 796 797rotate(options: RotateOption): Matrix4Transit 798 799Rotates this matrix object along the x, y, and z axes. 800 801> **NOTE** 802> 803> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.rotate](#rotate) instead. 804 805**System capability**: SystemCapability.ArkUI.ArkUI.Full 806 807**Parameters** 808 809| Name | Type | Mandatory | Description | 810| ------- | ----------------------------- | ---- | -------------- | 811| options | [RotateOption](#rotateoption) | Yes | Rotation configuration. | 812 813**Return value** 814 815| Type | Description | 816| --------------------------------- | ---------------------- | 817| [Matrix4Transit](#matrix4transit) | Matrix object after rotation. | 818 819## matrix4.transformPoint<sup>(deprecated)</sup> 820 821transformPoint(options: [number, number]): [number, number] 822 823Applies the current transformation effect to a coordinate point. 824 825> **NOTE** 826> 827> This API is deprecated since API version 10. You are advised to use [Matrix4Transit.transformPoint](#transformpoint) instead. 828 829**System capability**: SystemCapability.ArkUI.ArkUI.Full 830 831**Parameters** 832 833| Name | Type | Mandatory | Description | 834| ------- | ---------------- | ---- | ------------------ | 835| options | [number, number] | Yes | Point to be transformed. | 836 837**Return value** 838 839| Type | Description | 840| ---------------- | --------------------------- | 841| [number, number] | Point object after matrix transformation | 842