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

io.data2viz.geo.projection.AzimuthalEqualAreaProjection.kt Maven / Gradle / Ivy

There is a newer version: 0.8.0-RC5
Show newest version
package io.data2viz.geo.projection

import io.data2viz.geo.asin
import kotlin.math.sqrt

fun azimuthalEqualAreaProjection(init: MutableProjection.() -> Unit) = projection(AzimuthalEqualArea()) {
    scale = 124.75
    clipAngle = 180 - 1e-3
    init()
}

private val scale: (Double) -> Double = { cxcy -> sqrt(2 / (1 + cxcy)) }
private val angle: (Double) -> Double = { z -> 2 * (z / 2).asin }

class AzimuthalEqualArea: Azimuthal(scale, angle)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy