Skip to content

Instantly share code, notes, and snippets.

View x77f's full-sized avatar
👓
Observing

Utagawashi x77f

👓
Observing
View GitHub Profile
// Thank You Claude
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct Neighbor
{
int vertex;
struct Neighbor *next;
} Neighbor;
@x77f
x77f / args.md
Last active September 17, 2024 15:14
Efficient argument calculations in a simple manner.

Arguments

Arguments across Quadrants

For $z=ax+by$ and $\theta = tan^{-1}\left|\frac{y}{x}\right|$:

Quadrant arg(z) in rad arg(z) in deg
1st $\theta$ $\theta$
2nd $\pi - \theta$ $180° - \theta$
@x77f
x77f / fac.js
Created January 7, 2024 23:12
that old factorial algorithm
function fac(n) {
if (n === 1) return 1;
let result = 1;
for (let i = n; i > 0; i--) {
result *= i;
}
return result;
}
@x77f
x77f / factorial.js
Last active May 25, 2023 11:59
Unless you cross the MAX_SAFE_INT limit, it should work!
// Authors:
// Ilham Daiee Muntahi
// Shuddho Sharaf
// Date:
// October 20, 2022
// October 21, 2022
"use strict";
const factorial = function(number) {