All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.data2viz.shape.curve.Radial.kt Maven / Gradle / Ivy

There is a newer version: 0.8.0-RC5
Show newest version
package io.data2viz.shape.curve

import io.data2viz.geom.Path
import io.data2viz.shape.Curve
import kotlin.math.cos
import kotlin.math.sin

abstract class AbstractRadial(override val path: Path, val curve: Curve) : Curve {

    override fun areaEnd() {
        curve.areaEnd()
    }

    override fun lineStart() {
        curve.lineStart()
    }

    override fun lineEnd() {
        curve.lineEnd()
    }

    override fun areaStart() {
        curve.areaStart()
    }

    // TODO : rename a and r instead of x and y ?
    override fun point(x: Double, y: Double) {
        curve.point(y * sin(x), y * -cos(x));
    }
}

class RadialLinear(path: Path) : AbstractRadial(path, Linear(path))
class Radial(path: Path, curve: Curve) : AbstractRadial(path, curve)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy