Skip to content

Instantly share code, notes, and snippets.

View DimitarBogdanov's full-sized avatar
:octocat:
guthib.com

Dimitar Bogdanov DimitarBogdanov

:octocat:
guthib.com
View GitHub Profile
@DimitarBogdanov
DimitarBogdanov / shoelace.cs
Created March 31, 2026 14:34
Shoelace formula c#
double CalcPolygonArea(Vertex[] aV)
{
double aSz = 0;
for (int n = 0; n < aV.Length - 1; n++)
{
aSz += aV[n].X * (double) aV[n + 1].Y;
}
aSz += aV.Last().X * aV.First().Y;
for (int n = 0; n < aV.Length - 1; n++)
@DimitarBogdanov
DimitarBogdanov / gist:2c72dd31ef5ea465a50e8aca3ee15715
Created September 24, 2023 18:56
Luau __eq not working compile
Function 0 (__eq):
3: return true
LOADB R0 1
RETURN R0 1
Function 1 (??):
REMARK builtin setmetatable/2
REMARK allocation: table hash 0
1: local t = setmetatable({}, {
NEWTABLE R1 0 0