- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleSquare.java
More file actions
Latest commit
20 lines (15 loc) · 657 Bytes
/
Copy pathExampleSquare.java
File metadata and controls
20 lines (15 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
importjava.awt.geom.Point2D;
importjava.util.List;
publicclassExampleSquare {
publicstaticvoidmain(String[] args) {
Point2D.DoubletestPoint = newPoint2D.Double(0.4421937591102556, 101.88766462185495);
List<Point2D.Double> testPolygon = List.of(
newPoint2D.Double(0.430, 101.881),
newPoint2D.Double(0.451, 101.872),
newPoint2D.Double(0.444, 101.885),
newPoint2D.Double(0.448, 101.896)
);
booleanisInside = RayCasting.isPointInsidePolygon(testPoint, testPolygon);
System.out.println("Is the point inside the polygon? " + isInside);
}
}