---
title: "GLKVector2Subtract(_:_:)"
framework: GLKit
role: symbol
role_heading: Function
platforms: [iOS 5.0+, iPadOS 5.0+, macOS 10.8+, tvOS 9.0+]
path: "glkit/glkvector2subtract(_:_:)"
---

# GLKVector2Subtract(_:_:)

Returns the difference between two vectors.

## Declaration

```swift
func GLKVector2Subtract(_ vectorLeft: GLKVector2, _ vectorRight: GLKVector2) -> GLKVector2
```

## Parameters

- `vectorLeft`: The starting vector.
- `vectorRight`: The vector to subtract.

## Return Value

Return Value A new vector whose components each represent the difference between the components found in the same positions of the two source vectors.

## See Also

### Mathematical Operations Performed on Vectors

- [GLKVector2Negate(_:)](glkit/glkvector2negate(_:).md)
- [GLKVector2Normalize(_:)](glkit/glkvector2normalize(_:).md)
- [GLKVector2AddScalar(_:_:)](glkit/glkvector2addscalar(_:_:).md)
- [GLKVector2SubtractScalar(_:_:)](glkit/glkvector2subtractscalar(_:_:).md)
- [GLKVector2MultiplyScalar(_:_:)](glkit/glkvector2multiplyscalar(_:_:).md)
- [GLKVector2DivideScalar(_:_:)](glkit/glkvector2dividescalar(_:_:).md)
- [GLKVector2Add(_:_:)](glkit/glkvector2add(_:_:).md)
- [GLKVector2Multiply(_:_:)](glkit/glkvector2multiply(_:_:).md)
- [GLKVector2Divide(_:_:)](glkit/glkvector2divide(_:_:).md)
- [GLKVector2DotProduct(_:_:)](glkit/glkvector2dotproduct(_:_:).md)
- [GLKVector2Lerp(_:_:_:)](glkit/glkvector2lerp(_:_:_:).md)
- [GLKVector2Project(_:_:)](glkit/glkvector2project(_:_:).md)
- [GLKVector2Maximum(_:_:)](glkit/glkvector2maximum(_:_:).md)
- [GLKVector2Minimum(_:_:)](glkit/glkvector2minimum(_:_:).md)
