This file contains hidden or 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
local Curve = {} | |
function Curve:get(time) | |
for i=2,#self.keys,1 do | |
local nextKey = self.keys[i] | |
local preKey = self.keys[i-1] | |
if (nextKey.time == time) then | |
return nextKey.value | |
end |
This file contains hidden or 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
--[[ | |
polyzone.lua | |
Lua implementation of winding number algorithm to determine whether a point is inside a polygon | |
Credits: | |
https://gist.github.com/vlasky/d0d1d97af30af3191fc214beaf379acc - Public wn_PnPoly js conversion | |
http://geomalgorithms.com/a03-_inclusion.html - Original wn_PnPoly function | |
--]] |
This file contains hidden or 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
//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) { | |
const x = point[0], y = point[1]; | |
let wn = 0; | |
for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) { | |
let xi = vs[i][0], yi = vs[i][1]; | |
let xj = vs[j][0], yj = vs[j][1]; |
This file contains hidden or 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
local fileMt = {} | |
fileMt.__index = fileMt | |
function fileMt:exists() | |
local f = io.open(self.path,"r") | |
if f then | |
f:close() | |
end |
This file contains hidden or 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
# merger.py | |
# A simple image merger utility script. | |
# Written by Brayden Haynes - [email protected] | |
# usage: | |
# py merger.py mergefolder1 mergefolder2 mergefolder3 ... | |
import sys | |
import os, os.path | |
from PIL import Image |
This file contains hidden or 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
local defaultSeed = 1337 | |
local dot_product = { | |
[0x0]=function(x,y,z) return x + y end, | |
[0x1]=function(x,y,z) return -x + y end, | |
[0x2]=function(x,y,z) return x - y end, | |
[0x3]=function(x,y,z) return -x - y end, | |
[0x4]=function(x,y,z) return x + z end, | |
[0x5]=function(x,y,z) return -x + z end, | |
[0x6]=function(x,y,z) return x - z end, |