Skip to content

Instantly share code, notes, and snippets.

Avatar

Zach thejambi

View GitHub Profile
@thejambi
thejambi / point_in_polygon_using_winding_number.js
Created Jul 16, 2020 — forked from vlasky/point_in_polygon_using_winding_number.js
JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon
View point_in_polygon_using_winding_number.js
//JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon
//Based on C++ implementation of wn_PnPoly() published on http://geomalgorithms.com/a03-_inclusion.html
function pointInPolygon(point, vs) {
var x = parseFloat(point[0]), y = parseFloat(point[1]);
var wn = 0;
for (var i = 0, j = vs.length - 1; i < vs.length; j = i++) {
var xi = parseFloat(vs[i][0]), yi = parseFloat(vs[i][1]);
@thejambi
thejambi / FizzBuzz.java
Created Dec 11, 2012
Extended FizzBuzz
View FizzBuzz.java
public static void main(String[] args) {
HashMap<Integer, String> map = new HashMap<Integer, String>();
map.put(3, "Fizz");
map.put(5, "Buzz");
map.put(7, "Pop");
for (int i = 1; i <= 100; i++) {
boolean special = false;
for (int j : map.keySet()) {
You can’t perform that action at this time.