Ploting points, finding nearest and farthes, and ploting on Scatter graph using Java and Java FX
Tools Netbean 8.1 or Other (support JavaFX)
-Instalation (Point.Java)
- Open Netbean
- Creat New Project
- Java > Java Application
- Project Name : (example : Tugas)
- aunmark "Creat Main Class" > Finish
- Creat New Java Class > name: Point.java
- Insert code (copy paste)"Point.java" at folder to Point.java in Netbean
- File Data Points
- at Point.java Line 59 br=new BufferedReader(new FileReader("D:\Kuliah\Basisdata\D2\random 100k.csv")); change "D:\Kuliah\Basisdata\D2\random 100k.csv" with your file location.
-Running
- Run File
- insert X coordinate > Enter
- insert Y coordinate > Enter
- Wait Result
-Result included Nearest Point From Coordinate with distance. Farthest Point From Coordinate with Distance. Estimation running time to obtain both result. (screen shot IMG_Point.png)
-Instalation 2 (Ploting.Java)
- make sure already have Point.java in packages
- creat JavaFX main Class with (right clcik on package > new > JavaFX main Claass) or (right click on package >new > others >JavaFX > JavaFX Main Class)
- class name: Ploting > Finish
- Insert code (copy paste)"Ploting.java" at folder to Ploting.java in Netbean
-File Data Point
- at Ploting.java Line 44 "br=new BufferedReader(new FileReader("D:\Kuliah\Basisdata\test.csv"))" change file location with your "D:\Kuliah\Basisdata\test.csv" Note: if using 100k data take long time to process, recomended using data provided test1k.csv, if need small data use test20.csv so point will show correctly (that mean you can see the different)
-Runing
- Run File Ploting.java
- input X coordinate > Enter
- input Y coordinate > Enter
- Wait result
- you will see Scatter Graph From Point.
-Result Included Graph Ploting Point, Coordinate, Nearest Point with Distance, Farthest Point with Distance, Ploting Point Estimation Time and Estimation running time to obtain both result. Screen Shot (IMG_Ploting 1k Points.PNG) this using data Test1k.csv Screen Shot (IMG_Ploting 20 Points.PNG) this using data Test20.csv Note: Sorry we do not use 100k point because this take very long time to ploting on graph (but we use 100k points data in Point.java to compleate our task)