{{ message }}

Instantly share code, notes, and snippets.

# Al-buharie harieamjari

Created May 3, 2021
Solving the heat equation
View heat.c
 #include #include #include #include double init_fluid(double x) { return 10.0 * sin(2.0 * M_PI * x / 30.0) + 8.0 * cos(x / 2.0) + 2.0 * sin(x / 2.0); } int main() {
Last active May 1, 2021
Calculator
View calc.c
 /* Tiny calc * * Copyright (c) 2021 Al-buharie Amjari * * This file is license under MIT license * */ #include #include
Last active Apr 25, 2021
View packet.c
 #include #include #include #include double init_fluid(double x) { return 100.0 * sin(2.0 * M_PI * 0.4 * x) * pow(M_E, -pow(x - 15.0, 2.0) / (3.6 * 2.0)) / (3.6 * sqrt(2.0 * M_PI)); }
Created Apr 24, 2021
Integration of a normal distribution from 0 to +inf
View half.c
 #include #include #include #include #include static double derivative(double x){ return pow(M_E, -pow(x, 2.0)/2.0)/sqrt(2.0*M_PI);} int main(int argc, char **argv) {
Created Apr 22, 2021
View box2.c
 #include // so I wont have to do error handling #include #include // to output frames as png files #include // I/O #include #include #define FRAMES 50 /* this may be a vertex or a vector */
Created Apr 18, 2021
View triangle.c
 #include #include #include #include #include #include #define FRAMES 300 struct vec3D { double x, y, z;
Created Apr 17, 2021
View gold.c
 #include #include #include #define UNEXPECTED(c) \ { \ if (c != TOK_ERROR) { \ fprintf(stderr, "stream:%d:%d error: unexpected %s\n", line_tok_found, \ column_tok_found, tok_str(c)); \ } \
Created Apr 14, 2021
View wut.c
 const int main[] = { -476053503, -443744256, -442695680, -494927871, -443744256, -476045300, -509603825, -494858196, -476053503, -476024828, -285212672, -352321537, -442695680, -481296284, -905969664, -352321551, -476053504, -476024831, -285212672, 1819043176, 1634017391, 174617714, -1610612736, 805248739, 225, 2147483420, 1 };
Last active Apr 7, 2021
2D wave equation solver
View 2dwave00.c
 #include #include #include #include #include #ifdef NDEBUG #error "Don't turn NDEBUG!!" #endif
Last active Mar 30, 2021
View lb.c
 #include #include #include #include #include #ifdef NDEBUG #error "Don't turn NDEBUG!!" #endif