Here you can find the source of abs(int pos, double[] array)
Parameter | Description |
---|---|
pos | the position |
array | the array which contains the values |
public static double abs(int pos, double[] array)
//package com.java2s; /*//from w w w. ja va 2s . c o m * Copyright (C) 2010-2014 Andreas Maier * CONRAD is developed as an Open Source project under the GNU General Public License (GPL). */ public class Main { /** * Computes the absolute value of the complex number at position pos in the array * @param pos the position * @param array the array which contains the values * @return the absolute value */ public static double abs(int pos, double[] array) { return Math.sqrt(Math.pow(array[pos * 2], 2) + Math.pow(array[(2 * pos) + 1], 2)); } /** * Computes the absolute values of the complex number at posx, posy in the 2D array array. * * @param posx x position * @param posy y position * @param array the array * @return the absolute value of the complex number */ public static double abs(int posx, int posy, double[][] array) { return Math.sqrt(Math.pow(array[posx][posy * 2], 2) + Math.pow(array[posx][(2 * posy) + 1], 2)); } }