# NextDouble3

> Returns a uniformly random double3 value with all components in the interval [0, 1).

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.7/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## NextDouble3()

Returns a uniformly random double3 value with all components in the interval \[0, 1).

```csharp
public double3 NextDouble3()
```

### Returns

| Type                                                                    | Description                                            |
| ----------------------------------------------------------------------- | ------------------------------------------------------ |
| [double3](/engine/6000.7/script-reference/unity/mathematics/double3.md) | A uniformly random double3 value in the range \[0, 1). |

## NextDouble3(double3)

Returns a uniformly random double3 value with all components in the interval \[0, max).

```csharp
public double3 NextDouble3(double3 max)
```

### Parameters

**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): The componentwise maximum value to generate, exclusive.

### Returns

| Type                                                                    | Description                                              |
| ----------------------------------------------------------------------- | -------------------------------------------------------- |
| [double3](/engine/6000.7/script-reference/unity/mathematics/double3.md) | A uniformly random double3 value in the range \[0, max). |

## NextDouble3(double3, double3)

Returns a uniformly random double3 value with all components in the interval \[min, max).

```csharp
public double3 NextDouble3(double3 min, double3 max)
```

### Parameters

**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): The componentwise minimum value to generate, inclusive.**** (\[double3]\(/engine/6000.7/script-reference/unity/mathematics/double3)): The componentwise maximum value to generate, exclusive.

### Returns

| Type                                                                    | Description                                                |
| ----------------------------------------------------------------------- | ---------------------------------------------------------- |
| [double3](/engine/6000.7/script-reference/unity/mathematics/double3.md) | A uniformly random double3 value in the range \[min, max). |

### Remarks

Each component is computed as `NextDouble() * (max - min) + min`, so floating-point rounding can in rare cases return a component equal to the corresponding component of `max` rather than strictly less than it. Clamp the result if you require components strictly less than `max`.
