---
title: "init(origin:direction:)"
framework: spatial
role: symbol
role_heading: Initializer
path: "spatial/ray3dfloat/init(origin:direction:)-32dzt"
---

# init(origin:direction:)

Creates a ray from Spatial primitives that describe the origin and direction.

## Declaration

```swift
init(origin: Point3DFloat, direction: Vector3DFloat)
```

## Parameters

- `origin`: The origin of the ray.
- `direction`: The direction of the ray.

## Discussion

Discussion note: This function normalizes the direction vector.
