Example usage for com.google.common.math LinearTransformation mapping

List of usage examples for com.google.common.math LinearTransformation mapping

Introduction

In this page you can find the example usage for com.google.common.math LinearTransformation mapping.

Prototype

public static LinearTransformationBuilder mapping(double x1, double y1) 

Source Link

Document

Start building an instance which maps x = x1 to y = y1 .

Usage

From source file:de.muspellheim.datenverteiler.fuzzylib.FuzzySet.java

double zugehoerigkeit(double wert) {
    if (t1 <= wert && wert < t2)
        return LinearTransformation.mapping(t1, 0).and(t2, 1).transform(wert);
    else if (t2 <= wert && wert <= t3)
        return 1.0;
    else if (t3 < wert && wert <= t4)
        return LinearTransformation.mapping(t3, 1).and(t4, 0).transform(wert);

    return 0.0;//w w w.j  ava  2s  .c  om
}