Program can model a line based on points consisting of (x, y) coordinates using the cartesian system and program can calculate its length.
The project needs these dependencies:
Run this following command on terminal in your root project file
./gradlew test
- Run this following command on terminal in your root project file
./gradlew build
- Import the library into your program
- Create a line (x1, x2, y1, y2) using Line class like this:
int x1 = 1;
int y1 = 2;
int x2 = 3;
int y2 = 4;
Line line = new Line(x1, y1, x2, y2);
double length = line.getLength();