# half2

> Returns a half2 vector constructed from two half values.

## Definition

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

## half2(half, half)

Returns a half2 vector constructed from two half values.

```csharp
public static half2 half2(half x, half y)
```

### Parameters

**** (\[half]\(/engine/6000.6/script-reference/unity/mathematics/half)): The constructed vector's x component will be set to this value.**** (\[half]\(/engine/6000.6/script-reference/unity/mathematics/half)): The constructed vector's y component will be set to this value.

### Returns

| Type                                                                | Description                       |
| ------------------------------------------------------------------- | --------------------------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | half2 constructed from arguments. |

## half2(half2)

Returns a half2 vector constructed from a half2 vector.

```csharp
public static half2 half2(half2 xy)
```

### Parameters

**** (\[half2]\(/engine/6000.6/script-reference/unity/mathematics/half2)): The constructed vector's xy components will be set to this value.

### Returns

| Type                                                                | Description                       |
| ------------------------------------------------------------------- | --------------------------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | half2 constructed from arguments. |

## half2(half)

Returns a half2 vector constructed from a single half value by assigning it to every component.

```csharp
public static half2 half2(half v)
```

### Parameters

**** (\[half]\(/engine/6000.6/script-reference/unity/mathematics/half)): half to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | Converted value. |

## half2(float)

Returns a half2 vector constructed from a single float value by converting it to half and assigning it to every component.

```csharp
public static half2 half2(float v)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): float to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | Converted value. |

## half2(float2)

Return a half2 vector constructed from a float2 vector by componentwise conversion.

```csharp
public static half2 half2(float2 v)
```

### Parameters

**** (\[float2]\(/engine/6000.6/script-reference/unity/mathematics/float2)): float2 to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | Converted value. |

## half2(double)

Returns a half2 vector constructed from a single double value by converting it to half and assigning it to every component.

```csharp
public static half2 half2(double v)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): double to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | Converted value. |

## half2(double2)

Return a half2 vector constructed from a double2 vector by componentwise conversion.

```csharp
public static half2 half2(double2 v)
```

### Parameters

**** (\[double2]\(/engine/6000.6/script-reference/unity/mathematics/double2)): double2 to convert to half2

### Returns

| Type                                                                | Description      |
| ------------------------------------------------------------------- | ---------------- |
| [half2](/engine/6000.6/script-reference/unity/mathematics/half2.md) | Converted value. |
