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