From 99a28d2dba93642e89a62ecf905a3bd4f138318d Mon Sep 17 00:00:00 2001 From: mokha Date: Sun, 5 May 2019 19:48:09 -0600 Subject: split code into directories closer to what the instructor wants --- src/section-3/CartesianCoordinateSystem.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/section-3/CartesianCoordinateSystem.java (limited to 'src/section-3/CartesianCoordinateSystem.java') diff --git a/src/section-3/CartesianCoordinateSystem.java b/src/section-3/CartesianCoordinateSystem.java new file mode 100644 index 0000000..d6681f9 --- /dev/null +++ b/src/section-3/CartesianCoordinateSystem.java @@ -0,0 +1,7 @@ +package ca.mokhan.assignment1; + +public class CartesianCoordinateSystem { + public double calculateDistance(double x1, double y1, double x2, double y2) { + return Math.round(Math.pow(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2), 0.5) * 100) / 100.0; + } +} -- cgit v1.2.3