Originally Posted by
HeroFlame
create a method, distance, which takes, as parameters, the coordinates of two points ((x1, y1), (x2, y2)) as real numbers, and returns the distance between these points, using the distance forumula.
I'm lost as what to do, current code:
public class TriangleClassification
{
public static void main()
{
}
public static int distance (int x1, int x2, int y1, int y2)
{
double d = Math.sqrt(Math.pow((x2-x1),2) + Math.pow((y2-y1),2));
}
}
Where do I go from here?
use the
System.out.println("d is now " + d);
what else are you trying to do?