Latest 0.1.0
Homepage https://github.com/ryohey/Smooth.swift
License MIT
Platforms ios 9.0
Frameworks Foundation
Authors

Smooth.swift

CocoaPods
Carthage compatible

Turn arrays into smooth functions.
Interpolation functions are ported from Smooth.js.

Installation

CocoaPods

pod 'Smooth'

Carthage

github "ryohey/Smooth.swift"

Input

2018-07-28 13 22 52

Interpolation

2018-07-28 13 22 23

Smoothing

2018-07-28 13 22 33

Use with SceneKit

In order to make as little dependence as possible, Smooth.swift does not use SceneKit, but in order to make it easy to use it, a VectorType is added.
Since SCNVector3 and SCNVector4 are concrete types already implementing VectorType, you can use VectorInterpolator by simply specifying it with extension.

extension SCNVector3: Vector3, VectorType {}
extension SCNVector4: Vector4, VectorType {}

VectorInterpolator is generated by providing Interpolator which interpolates for each element.

VectorInterpolator(points: [SCNVector3(0.1, 0.2, 0.5), SCNVector3(0.5, 0.6, 0.1)], interpolatorCreator: { LinearInterpolator(points: $0).interpolate })

Latest podspec

{
    "name": "Smooth",
    "version": "0.1.0",
    "summary": "Interpolate number arrays",
    "description": "Heavily based on [Smooth.js](https://github.com/osuushi/Smooth.js/). Smoothing and interpolation number arrays.",
    "homepage": "https://github.com/ryohey/Smooth.swift",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ryohey": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ryohey/Smooth.swift.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.1",
    "source_files": "Sources/Core/**/*",
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This