---
title: "rotated(by:)"
framework: spatial
role: symbol
role_heading: Instance Method
path: "spatial/ray3dfloat/rotated(by:)-3vmkj"
---

# rotated(by:)

Returns a ray that’s rotated by the specified quaternion.

## Declaration

```swift
func rotated(by quaternion: simd_quatf) -> Ray3DFloat
```

## Parameters

- `quaternion`: The quaternion that defines the rotation.

## Discussion

Discussion Returns A ray with a direction that’s rotated by the specified quaternion.
