// Assume we have a series of x,y coordinates that make up the end points of a polygon. This program computes the polygon's total distance around (its perimeter). We use the Euclidean distance // formula to compute the distance between any two points x1,y1 and x2,y2 (Math.sqrt((x1-x2)^2+(y1-y2)^2). We store all of the x,y coordinates in two arrays. We assume int coordinates but // distance is computed as a double public class ComputePerimeter { public static void main(String[] args) { int[][] points = {{1,1},{5,3},{8,2},{6,9},{8,3},{4,2},{3,4}}; int n = 7; // 7 points double sum = 0.0; for(int i=0;i