Here you can find the source of euclideanDistance(float[] points, int p1, int p2, boolean isDisp, double width, double height)
private static double euclideanDistance(float[] points, int p1, int p2, boolean isDisp, double width, double height)
//package com.java2s; /******************************************************************************* * Copyright (c) 2016 Weasis Team and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w ww . jav a2 s . c om*/ * Nicolas Roduit - initial API and implementation *******************************************************************************/ public class Main { private static double euclideanDistance(float[] points, int p1, int p2, boolean isDisp, double width, double height) { float dx = points[p1] - points[p2]; float dy = points[p1 + 1] - points[p2 + 1]; if (isDisp) { dx *= width; dy *= height; } return Math.sqrt(dx * dx + dy * dy); } }