Skip to content

Instantly share code, notes, and snippets.

View cmxiv's full-sized avatar
👨‍💻

Siddhant Tandon cmxiv

👨‍💻
View GitHub Profile
@cmxiv
cmxiv / matrix_rotation_approach2.cpp
Last active December 27, 2015 16:36
HackerRank Matrix Rotation Approach 2
#include <iostream>
using namespace std;
//Global variables
long** matrix;
long M, N, R;
//================
//Matrix functions - Declaration
void initMatrix();
@cmxiv
cmxiv / matrix_rotation_approach1.cpp
Last active December 27, 2015 16:35
HackerRank Matrix Rotation Approach 1
#include <iostream>
using namespace std;
//Global variables
long** matrix;
long M, N, R;
//================
//Matrix functions - Declaration
void initMatrix();
@cmxiv
cmxiv / BatmanInsignia
Created January 3, 2014 12:44
Batman Insignia in MATLAB.
clf;
clear;
syms x y
f1 = ( sqrt( abs(abs(x) - 3)/(abs(x) - 3) )*(x/7)^2 ) + ( sqrt( abs(y + 3*sqrt(33)/7)/(y + 3*sqrt(33)/7) )*(y/3)^2 ) - 1;
f2 = abs(x/2) - (3*sqrt(33)-7)/112*x^2 - 3 + sqrt( 1 - (abs(abs(x) - 2) - 1)^2 ) - y;
f3 = 9*sqrt(abs((abs(x)-1)*(abs(x)-.75))/((1-abs(x))*(abs(x)-.75))) - 8*abs(x) - y;
f4 = 3*abs(x) + .75*sqrt( abs((abs(x)-.75)*(abs(x)-.5))/((.75-abs(x))*(abs(x)-.5)) ) - y;
f5 = 2.25*sqrt(abs((x-.5)*(.5+x)) / ((.5-x)*(.5+x))) - y;
f6 = 6*sqrt(10)/7 + (1.5 - .5*abs(x))*sqrt(abs(abs(x)-1)/(abs(x)-1)) - 6*sqrt(10)*sqrt(4 - (abs(x)-1)^2)/14 - y;