What is VectorMath?

VectorMath is a Swift library for Mac and iOS that implements common 2D and 3D vector and matrix functions, useful for games or vector-based graphics.

VectorMath takes advantage of Swift language features such as function and operator overloading and struct methods to provide a more elegant interface than most C, C++ or Cocoa-based graphics APIs.

VectorMath also provides a handy replacement for the GLKit vector math types and functions, which are not available yet in Swift due to their reliance on union types.

VectorMath is a completely standalone library, relying only on the Foundation framework. However, it provides optional compatibility extensions for SceneKit and Quartz (CoreGraphics/CoreAnimation) for interoperability with UIKit, AppKit, SpriteKit and SceneKit.

VectorMath is designed to be efficient, but has not been heavily optimized yet, and does not yet take advantage of architecture-specific hardware acceleration using the Accelerate framework.


  • Pricing: Free
  • Resource Link: https://github.com/nicklockwood/VectorMath
  • Resource Maker on Twitter: Nick Lockwood
  • Mobile Platform Destination: iOS Apps
  • Mobile Platform Support: Native iOS
  • Programming Languages: Swift
  • iOS Versions Supported: iOS 7.0+, iOS 8.0+, iOS 9.0+, iOS 10.0+, iOS 11.0+, iOS 12.0+