All Projects → apexskier → SKLinearAlgebra

apexskier / SKLinearAlgebra

Licence: MIT license
Swift extensions for Linear Algebra with SceneKit

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to SKLinearAlgebra

vg
Vector-geometry toolbelt for 3D points and vectors
Stars: ✭ 106 (+100%)
Mutual labels:  linear-algebra, vectors
zalgebra
Linear algebra library for games and real-time graphics.
Stars: ✭ 129 (+143.4%)
Mutual labels:  linear-algebra, vectors
vec-la
Tiny linear algebra library specifically for 2d
Stars: ✭ 41 (-22.64%)
Mutual labels:  linear-algebra, vectors
eigen-js
⚡ Eigen-js is a port of the Eigen C++ linear algebra library
Stars: ✭ 78 (+47.17%)
Mutual labels:  linear-algebra
math-for-ml
Mathematical preliminaries for machine learning
Stars: ✭ 15 (-71.7%)
Mutual labels:  linear-algebra
NumNet
Numpy style scientific programming package
Stars: ✭ 17 (-67.92%)
Mutual labels:  linear-algebra
HxSTLParser
Basic STL loader for SceneKit
Stars: ✭ 23 (-56.6%)
Mutual labels:  scenekit
Tom and Jerry
A multiuser AR game based on ARKit 2 and MultipeerConnectivity
Stars: ✭ 24 (-54.72%)
Mutual labels:  scenekit
SpriteKit-BubbleGame
a simple 2D game for iOS SpriteKit practice
Stars: ✭ 25 (-52.83%)
Mutual labels:  scenekit
PyArmadillo
PyArmadillo: an alternative approach to linear algebra in Python
Stars: ✭ 58 (+9.43%)
Mutual labels:  linear-algebra
SceneKit-PortalMask
Clean class to create a portal in SceneKit for use in ARKit.
Stars: ✭ 60 (+13.21%)
Mutual labels:  scenekit
vec
Fast, safe mutable dynamic arrays for OCaml
Stars: ✭ 25 (-52.83%)
Mutual labels:  vectors
linalg
Linear algebra library based on LAPACK
Stars: ✭ 42 (-20.75%)
Mutual labels:  linear-algebra
eigen
Owl's OCaml Interface to Eigen3 C++ Library
Stars: ✭ 30 (-43.4%)
Mutual labels:  linear-algebra
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (-13.21%)
Mutual labels:  linear-algebra
ARKit-FocusNode
FocusSquare class taken straight from Apple's ARKit examples and packed up for anyone to use with ease.
Stars: ✭ 50 (-5.66%)
Mutual labels:  scenekit
ARMultiuser
this demo use arkit 2.0, realize multiplayer play together! The project refers to the official demo!
Stars: ✭ 30 (-43.4%)
Mutual labels:  scenekit
SplashGeom
Open-source C++ library for geometry and linear algebra
Stars: ✭ 22 (-58.49%)
Mutual labels:  linear-algebra
fastai-num-linalg-v2-zh
📖 [译] fast.ai 数值线性代数讲义 v2
Stars: ✭ 72 (+35.85%)
Mutual labels:  linear-algebra
CNCC-2019
Computational Neuroscience Crash Course (CNCC 2019)
Stars: ✭ 26 (-50.94%)
Mutual labels:  linear-algebra

SKLinearAlgebra

Build Status

This library allows common vector operations using SceneKit's native types: SCNVector3, SCNVector4, and SCNMatrix4. It also provides useful linear algebra functions for 3D graphics.

It has been written in the style of Swift, intending to enhance and complete Scenekit's existing functions.

Features

Tests are complete for all implemented features.

Operations

  • equality (==)
  • inequality (!=)
  • equivalence (~=)
    • Returns true if the components are close to equal to each other.
  • inequivalence (!~=)
  • addition (+, +=)
  • subtraction (-, -=)
  • dot product (*)
  • scalar multiplication (*, *=)
  • scalar division (/, /=)
  • cross product (×)
  • subscript access (v[0], m[1, 2])
    • Zero based indexing
    • Access by [row, column]

Functions

  • cross product (cross(a: Vector, b: Vector))
  • magnitude (magnitude(v: Vector))
  • normalize (normalize(v: Vector))
  • angle between (angle(a: Vector, b: Vector))
  • component (component(a: Vector, b: Vector)) - comp_{b} a
    • Read this as "the component of a onto b", it would be written comp_{b} a.
  • projection (projection(a: Vector, b: Vector))
    • Read this as "the projection of a onto b", it would be written proj_{b} a
  • determinate (det(m: Matrix))
  • transpose (transpose(m: Matrix))
  • inverse (inverse(m: Matrix))

Usage

The documentation for using a custom Swift library is lacking at the moment, but my process has been as follows:

  1. Clone [email protected]:apexskier/SKLinearAlgebra.git into your project directory.
  2. Drag SKLinearAlgebra.xcodeproj into your Xcode project.
  3. Select your project, select your target, under General find "Linked Frameworks and Libraries".
  4. Add SKLinearAlgebra.framework, either from the + button or by dragging in SKLinearAlgebra/Products/SKLinearAlgebra.framework from the project navigator.
// Example import statements

import SceneKit
import SKLinearAlgebra

let vector = SCNVector4(x: 1, y: 2, z: 3, w: 4)
vector *= 4
println(vector)

Future Plans

  • Some kind of support for bases (origin + 3 vectors)
    • Conversion between basis
  • Use specific type aliases
    • Vectors for colors, locations, directions, rotations
  • Rotation utilities
  • Torque and Force utilities
  • Utilize Accelerate or Surge

You should follow me on Twitter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].