---
title: "init(x:y:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/simd2/init(x:y:)"
---

# init(x:y:)

Creates a new vector from the given elements.

## Declaration

```swift
init(x: Scalar, y: Scalar)
```

## Parameters

- `x`: The first element of the vector.
- `y`: The second element of the vector.
