Example usage for java.lang Math pow

List of usage examples for java.lang Math pow

Introduction

In this page you can find the example usage for java.lang Math pow.

Prototype

@HotSpotIntrinsicCandidate
public static double pow(double a, double b) 

Source Link

Document

Returns the value of the first argument raised to the power of the second argument.

Usage

From source file:Main.java

public static double tile2lon(int x, int z) {
    return x / Math.pow(2.0, z) * 360.0 - 180;
}

From source file:Main.java

public static double getSE(double x, double meanX) {
    return Math.pow((x - meanX), 2.0);
}

From source file:Main.java

public static long calcBezier(float interpolatedTime, float p0, float p1, float p2) {
    return Math.round((Math.pow((1 - interpolatedTime), 2) * p0)
            + (2 * (1 - interpolatedTime) * interpolatedTime * p1) + (Math.pow(interpolatedTime, 2) * p2));
}

From source file:Main.java

public static float getPoint2PointDistance(float x1, float y1, float x2, float y2) {
    return (float) Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2));
}

From source file:Main.java

public static double distanceFromRssi(int rssi, int txPower0m) {
    int pathLoss = txPower0m - rssi;
    return Math.pow(10, (pathLoss - 41) / 20.0);
}

From source file:Main.java

public static double transfromToDouble(int data, int radix) {
    double temp = (double) data;
    temp = temp / Math.pow(10.0, radix);
    return temp;//from w w  w  . jav a 2 s.c  om
}

From source file:Main.java

public static int getDistance(float _firstX, float _firstY, float _secondX, float _secondY) {
    return (int) Math.sqrt(Math.pow(_firstX - _secondX, 2) + Math.pow(_firstY - _secondY, 2));
}

From source file:Main.java

public static double roundFraction(Double value, int precision) {
    int scale = (int) Math.pow(10, precision);
    return (double) Math.round(value * scale) / scale;
}

From source file:Main.java

public static float pow(float x, float exponent) {
    return (float) Math.pow(x, exponent);
}

From source file:Main.java

public static double tile2lat(int y, int z) {
    double n = Math.PI - (2.0 * Math.PI * y) / Math.pow(2.0, z);
    return Math.toDegrees(Math.atan(Math.sinh(n)));
}