> For the complete documentation index, see [llms.txt](https://pahutyakv.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pahutyakv.gitbook.io/docs/mega-extension-pack/vector.md).

# Vector

#### **With**

* `WithX(float x)` — Creates a new Vector2/Vector3 with a replaced X component.
* `WithY(float y)` — Creates a new Vector2/Vector3 with a replaced Y component.
* `WithZ(float z)` — Creates a new Vector3 with a replaced Z component.
* `WithXY(float x, float y)` — Creates a new Vector3 with replaced X and Y components.
* `WithXZ(float x, float z)` — Creates a new Vector3 with replaced X and Z components.
* `WithYZ(float y, float z)` — Creates a new Vector3 with replaced Y and Z components.

***

#### **With Increment**

* `WithIncrementX(float x)` — Returns a Vector2/Vector3 with X increased by the specified amount.
* `WithIncrementY(float y)` — Returns a Vector2/Vector3 with Y increased by the specified amount.
* `WithIncrementZ(float z)` — Returns a Vector3 with Z increased by the specified amount.
* `WithIncrementXY(float x, float y)` — Returns a Vector3 with X and Y increased by the specified amounts.
* `WithIncrementXZ(float x, float z)` — Returns a Vector3 with X and Z increased by the specified amounts.
* `WithIncrementYZ(float y, float z)` — Returns a Vector3 with Y and Z increased by the specified amounts.

***

#### **Multiply**

* `Multiply(Vector2/Vector3 other)` — Multiplies two vectors component-wise.
* `Multiply(float value)` — Scales all vector components by a scalar multiplier.

***

#### **Divide**

* `Divide(Vector2/Vector3 other)` — Divides two vectors component-wise.
* `Divide(float value)` — Divides all vector components by a scalar value.

***

#### **Summation**

* `Summation()` — Calculates the summation of the components of the vector.

***

#### **Abs**

* `Abs(bool X = true, bool Y = true, bool Z = true)` — Returns a vector with optional absolute value applied per component.

***

#### **Round / Invert / Clamp**

* `Rounded(bool X = true, bool Y = true, bool Z = true)` — Rounds selected components of the vector.
* `Inverted(bool X = true, bool Y = true, bool Z = true)` — Inverts selected components by multiplying them by -1.
* `Clamped(float min, float max)` — Clamps all vector components between the given min and max values.

***

#### **Lerp / Distance / Angle To**

* `LerpTo(Vector2/Vector3 target, float t)` — Interpolates toward the target vector by factor t.
* `DistanceTo(Vector2/Vector3 target)` — Calculates the distance between two vectors.
* `AngleTo(Vector2/Vector3 target)` — Calculates the angle between two vectors.

***

#### **Dot/Cross Product**

* `DotProduct(Vector2/Vector3 other)` — Computes the dot product between two vectors.
* `CrossProduct(Vector3 other)` — Computes the cross product between two Vector3 values.

***

#### **Midpoint**

* `Midpoint(Vector2/Vector3 other)` — Calculates the midpoint between two vectors.

***

#### **Checks**

* `IsCollinear(Vector2/Vector3 other)` — Checks whether two vectors are collinear.
* `IsOrthogonal(Vector2/Vector3 other)` — Checks whether two vectors are perpendicular.
