Last active
August 21, 2020 15:09
-
-
Save mayararysia/71e6755ab657936f79fc6a30f1c388ad to your computer and use it in GitHub Desktop.
An example of a class Main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main { | |
public static void main(String[] args) { | |
Coordinate pointA = new Coordinate(5.0, 6.0); // (5,6) pointA object is of type Coordinate | |
Coordinate origin = new Coordinate(0.0, 0.0); // (0,0) origin object is of type Coordinate | |
System.out.println("abscissa - point A> x: " + pointA.getX() ); // abscissa - point A: 5 | |
System.out.println("abscissa - origin> x: " + origin.getX() ); // abscissa - origin: 0 | |
System.out.println("-- Distance: "+ pointA.distance(origin) ); //result: 7.81 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment