---
title: "simd_quaternion(_:_:)"
framework: simd
role: symbol
role_heading: Function
path: "simd/simd_quaternion(_:_:)-59cuw"
---

# simd_quaternion(_:_:)

## Declaration

```swift
func simd_quaternion(_ from: simd_half3, _ to: simd_half3) -> simd_quath
```

## Parameters

- `from`: A normalized three-element vector.
- `to`: A normalized three-element vector.

## Discussion

Discussion Construct a quaternion that rotates from one vector to another. The rotation axis is simd_cross(from, to). If from and to point in opposite directions (to within machine precision), an arbitrary rotation axis is chosen, and the angle is pi radians.
