<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CGVector",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@S@CGVector"
  },
  "title" : "CGVector"
}
-->

# CGVector

A structure that contains a two-dimensional vector.

```
struct CGVector
```

## Topics

### Special Values

[`zero`](/documentation/CoreFoundation/CGVector/zero)

[`init()`](/documentation/CoreFoundation/CGVector/init())

Creates a vector whose components are both zero.

### Geometric Properties

[`dx`](/documentation/CoreFoundation/CGVector/dx)

The x component of the vector.

[`dy`](/documentation/CoreFoundation/CGVector/dy)

The y component of the vector.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)