calculate Concentration - Android java.lang

Android examples for java.lang:Math

Description

calculate Concentration

Demo Code


//package com.java2s;
import android.util.Log;

public class Main {
    private static String logtag = "MU";

    public static double[] calcConcentration(double[] distance,
            double[] coeffs) {
        double[] conc = new double[2];
        conc[0] = (distance[0] - coeffs[2]) / coeffs[0];
        Log.d(logtag, Double.toString(conc[0]));
        double err0 = Math.pow(
                Math.pow(distance[1], 2) + Math.pow(coeffs[3], 2), 0.5);
        conc[1] = conc[0]//www.  j a v a 2s.co  m
                * Math.pow(Math.pow(err0 / (distance[0] - coeffs[2]), 2)
                        + Math.pow(coeffs[1] / coeffs[0], 2), 0.5);
        Log.d(logtag, Double.toString(conc[1]));
        return conc;
    }
}

Related Tutorials