---
title: SCNVector4
framework: scenekit
role: symbol
role_heading: Structure
path: scenekit/scnvector4
---

# SCNVector4

A representation of a four-component vector.

## Declaration

```swift
struct SCNVector4
```

## Overview

Overview SceneKit uses four-component vectors to represent multiple kinds of data: Axis-angle rotation or torque. The x, y, and z fields contain the normalized x-, y-, and z-components of the rotation axis, and the w field contains the rotation angle, in radians, or torque magnitude, in newton-meters. Color value (or range). The x, y, z, and w fields contain the red, green, blue, and alpha components of the color, or the width of the color variation range in each component. important: In macOS, the x, y, z and w fields in this structure are CGFloat values. In iOS, tvOS, and watchOS, these fields are float values.

## Topics

### Components

- [x](scenekit/scnvector4/x.md)
- [y](scenekit/scnvector4/y.md)
- [z](scenekit/scnvector4/z.md)
- [w](scenekit/scnvector4/w.md)

### Creating Vectors

- [SCNVector4Make(_:_:_:_:)](scenekit/scnvector4make(_:_:_:_:).md)

### Converting Vector Types

- [SCNVector4FromGLKVector4(_:)](scenekit/scnvector4fromglkvector4(_:).md)
- [SCNVector4ToGLKVector4(_:)](scenekit/scnvector4toglkvector4(_:).md)

### Comparing Vectors

- [SCNVector4EqualToVector4(_:_:)](scenekit/scnvector4equaltovector4(_:_:).md)

### Zero Constant

- [SCNVector4Zero](scenekit/scnvector4zero.md)

### Initializers

- [init()](scenekit/scnvector4/init().md)
- [init(_:)](scenekit/scnvector4/init(_:)-5q2cx.md)
- [init(_:)](scenekit/scnvector4/init(_:)-6w6mx.md)
- [init(_:_:_:_:)](scenekit/scnvector4/init(_:_:_:_:)-6otq6.md)
- [init(_:_:_:_:)](scenekit/scnvector4/init(_:_:_:_:)-85e6w.md)
- [init(_:_:_:_:)](scenekit/scnvector4/init(_:_:_:_:)-93hx1.md)
- [init(_:_:_:_:)](scenekit/scnvector4/init(_:_:_:_:)-pk7r.md)
- [init(x:y:z:w:)](scenekit/scnvector4/init(x:y:z:w:)-37b3a.md)
- [init(x:y:z:w:)](scenekit/scnvector4/init(x:y:z:w:)-7hxmu.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [Sendable](swift/sendable.md)

## See Also

### Vectors

- [SCNVector3](scenekit/scnvector3.md)
