# Vector3

Vector3 represents three-dimensional space as coordinates, physical quantities, or directions, containing three numerical components (x, y, and z). It is used in Unity for physics, animations, and transformations.

## Properties

Returns a version of this Vector3 with a magnitude of one, maintaining its direction. Useful for unit direction vectors.

Provides the length of a Vector3, calculated as the Euclidean distance to (0,0,0), useful for distance calculations in 3D space.

Returns the square of the magnitude, an alternative for performance-sensitive calculations where exact distance is not necessary.

Represents the x-coordinate of the Vector3, allowing direct manipulation or reading of its x-component.

Corresponds to the y-coordinate of the Vector3, for manipulating or reading the y-component.

Represents the z-coordinate of the Vector3, used for direct manipulation or reading of the z-component.

Generates a Vector3 with zero values for all coordinates, representing the origin in 3D space or indicating no motion or rotation.

Generates a Vector3 object with all components set to 1, useful for pointing diagonally in 3D space.

Returns a Vector3 pointing towards the positive Z-axis, useful for designating a forward direction.

Provides a Vector3 pointing towards the negative Z-axis, often used to designate a backward direction.

Offers a Vector3 pointing upwards along the positive Y-axis, handy for upward movements or orientations.

Represents a Vector3 pointing downwards along the negative Y-axis, typically used for downward directions.

Returns a Vector3 pointing in the negative X-axis direction, used to signify left direction in 3D space.

Provides a Vector3 pointing towards the positive X-axis, recognized as the right direction in 3D space.

Yields a Vector3 with all components set to positive infinity, useful for representing very large values.

Generates a Vector3 with all components set to negative infinity, representing the smallest possible values in 3D space.

Provides a very small positive number, used for comparisons to determine if Vector3 components are approximately zero, considering floating-point inaccuracies.

A small positive number used in square root calculations, representing a negligible threshold value for comparing Vector3 magnitudes.

## Methods

Changes the x, y, and z values of an existing Vector3 object, useful for simultaneous updates to all three components.

#### Parameters

##### newX

The new value for the x-coordinate.

##### newY

The new value for the y-coordinate.

##### newZ

The new value for the z-coordinate.

#### Returns

Multiplies each component of the Vector3 by the corresponding components of another Vector3, used to alter the scale without changing its direction.

#### Parameters

##### scale

Vector3A Vector3 by which the instance vector is scaled.

#### Returns

Adjusts the Vector3 to a length of one while maintaining its direction, useful for when only the direction is of interest.

#### Returns

Creates a smooth transition between two Vector3 points on a sphere's surface, ideal for smooth transitions in rotations or positions.

Similar to 'Slerp' but allows the 't' value to exceed the 0 to 1 range, enabling extrapolation beyond the original points.

Gradually rotates a Vector3 'current' to align with a 'target' Vector3, with specified maximum rotation and magnitude change limits.

Performs linear interpolation between two Vector3s, transitioning from 'a' to 'b' based on the 't' ratio.

Similar to 'Lerp', this method performs linear interpolation between two points, but allows 't' to exceed the 0 to 1 range, enabling extrapolation.

Moves a Vector3 ('current') incrementally towards a target Vector3 ('target') at a specified 'maxDistanceDelta'.

Creates a new Vector3 from the product of corresponding components of two given Vector3s, affecting the size without changing direction.

Calculates the cross product of two Vector3 instances, resulting in a Vector3 perpendicular to both, used for finding normals or rotation axes.

Reflects a Vector3 off a surface with a specified normal, useful for simulating reflections or ricochets.

Normalizes a Vector3, returning a new Vector3 with the same direction but a magnitude of 1, useful for direction without magnitude concern.

Calculates the Dot Product of two Vector3s, useful for determining directional alignment or the angle between vectors.

Projects a Vector3 onto another, useful for finding the component of one vector in the direction of another.

Projects a Vector3 onto a plane defined by a normal orthogonal Vector3, useful for aligning objects to surfaces.

Calculates the angle in degrees between two Vector3s, useful for determining the required rotation to align one Vector3 with another.

Calculates the angle between two Vector3s with a sign indicating rotation direction around a given axis.

Calculates the distance between two Vector3 points, typically used to determine how far apart two objects are in 3D space.

Limits the magnitude of a Vector3 to a specified maximum, useful for constraining movement or other vector magnitudes.

Returns the magnitude (length) of a Vector3, useful for distance calculations from the origin.

#### Parameters

##### vector

Vector3The Vector3 of which to calculate the magnitude.

#### Returns

The magnitude of the Vector3.

Calculates the square of the magnitude of a Vector3, often used for performance reasons in relative length comparisons.

#### Parameters

##### vector

Vector3The Vector3 of which to calculate the square of the magnitude.

#### Returns

The square of the magnitude of the Vector3.

Returns a Vector3 composed of the smallest x, y, and z components from two given Vector3s, useful for bounding calculations.

Produces a Vector3 from the largest x, y, and z components of two given Vector3s, useful for defining bounds or extents.