Normalize
![normalize](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/normalize-8cc0608cb299b58c5698c6bae47e8255.png)
Use Normalize to normalize the input vector. That is, return a vector of the same direction as the input with a length of 1. Supported types: Vec2, Vec3, and Vec4. Normalize is in the Math category.
Input
Name | Data Type | Description |
---|---|---|
A | Vec4 | The vector to be normalized. |
Output
Name | Data Type | Description |
---|---|---|
Result | Vec4 | The normalized vector with a length of 1. |
Example
![normalize example](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/normalize_example-32459b7d5ca9a60022c2e05130f4d1f7.gif)
This example calculates and gets the normalized direction from the alien to the UFO, then transforms the alien to move towards the UFO‘s direction at a uniform speed.
![normalize node](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/normalize_node-8c3859aa3186af1f3af4a00ec51b152a.png)