From f263324f457897de8a1fd95250526d9114b84778 Mon Sep 17 00:00:00 2001 From: mokha Date: Tue, 7 May 2019 09:24:33 -0600 Subject: add documentation --- src/Q3/CartesianCoordinateSystem.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/Q3/CartesianCoordinateSystem.java') diff --git a/src/Q3/CartesianCoordinateSystem.java b/src/Q3/CartesianCoordinateSystem.java index b825cc2..c41dbeb 100644 --- a/src/Q3/CartesianCoordinateSystem.java +++ b/src/Q3/CartesianCoordinateSystem.java @@ -1,6 +1,24 @@ +/** + * Assignment 1, COMP268 Class: CartesianCoordinateSystem.java + * + * @description Represents an object that can calculate the distance between two points on a + * cartesian plain + * @author: mo khan Student ID: 3431709 + * @date May 7, 2019 + * @version 1.0 + */ package Q3; public class CartesianCoordinateSystem { + /** + * Calculate the distance between two points. + * + * @param x1 x coordinate for the first point. + * @param y1 y coordinate for the first point. + * @param x2 x coordinate for the second point. + * @param y2 y coordinate for the second point. + * @return the distance between the two points + */ 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