Skip to content

Commit

Permalink
make serializable, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Jun 2, 2018
1 parent 5c298b8 commit 12fe295
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.20'
ext.kotlin_version = '1.2.41'
ext.dokka_version = '0.9.14'

repositories {
Expand All @@ -21,7 +21,7 @@ plugins {
}

group 'com.github.sanity'
version '1.4.13'
version '1.4.15'

apply plugin: 'java'
apply plugin: 'kotlin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.github.sanity.pav.spline

import com.github.sanity.pav.*
import com.github.sanity.pav.spline.MonotoneSpline.ExtrapolationStrategy.*
import java.io.Serializable
import java.util.*

/**
Expand All @@ -19,7 +20,7 @@ import java.util.*
* @throws IllegalArgumentException if the control points are not monotonic.
*/

class MonotoneSpline @JvmOverloads constructor(inputPoints: List<Point>, tangentStrategy: TangentStrategy = FritschCarlsonTangentStrategy()) {
class MonotoneSpline @JvmOverloads constructor(inputPoints: List<Point>, tangentStrategy: TangentStrategy = FritschCarlsonTangentStrategy()) : Serializable {

private val minimumXDistance = 0.000001

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package com.github.sanity.pav.spline

import com.github.sanity.pav.Point
import java.io.Serializable
import java.util.*

interface TangentStrategy {
fun compute(points: Iterable<PointWithSecants>): ArrayList<PointWithTangents>
}

data class PointWithTangents(val pointWithSecants: PointWithSecants, val tangent: Double) {
data class PointWithTangents(val pointWithSecants: PointWithSecants, val tangent: Double) : Serializable {
val x = pointWithSecants.point.x
val y = pointWithSecants.point.y
}

data class PointWithSecants(val point: Point, val secantBefore: Secant?, val secantAfter: Secant?)
data class PointWithSecants(val point: Point, val secantBefore: Secant?, val secantAfter: Secant?) : Serializable

data class Secant(val slope: Double) {
data class Secant(val slope: Double) : Serializable {
constructor(start: Point, end: Point) : this((end.y - start.y) / (end.x - start.x))
}

0 comments on commit 12fe295

Please sign in to comment.