Skip to content

Instantly share code, notes, and snippets.

View gauravalgo's full-sized avatar
🎯
Focusing

gaurav sharma gauravalgo

🎯
Focusing
View GitHub Profile
@gauravalgo
gauravalgo / unordered_map_pair_uasage.cpp
Created May 2, 2023 09:29
unordered_map_pair_uasage
#include <iostream>
#include <unordered_map>
#include <utility>
typedef std::pair<std::string, std::string> pair;
struct pair_hash
{
template <class T1, class T2>
@gauravalgo
gauravalgo / SimpleVS.glsl
Last active July 16, 2022 16:23
shaders
#version 330
out vec4 outColor;
uniform vec2 iResolution;
uniform vec2 iMouse;
uniform float iTime;
#define ROTATE false
#define flag true
@gauravalgo
gauravalgo / TODO
Last active August 17, 2020 05:00
TODO List
https://www.youtube.com/watch?v=6YSsvMb6tVI -- > practisce
https://www.youtube.com/watch?v=6YSsvMb6tVI ---> practisce
https://www.youtube.com/watch?v=27tFyKc6g3U ---> practisce
https://www.youtube.com/watch?v=h5t3hP2yx1s ---> practisce
@gauravalgo
gauravalgo / Gradient.cpp
Created July 28, 2020 15:33 — forked from NickBeeuwsaert/Gradient.cpp
Small C++ Gradient class
#include "Gradient.h"
#include <vector>
Gradient::GradientColor::GradientColor(float _r, float _g, float _b, float _a):r(_r), g(_g), b(_b), a(_a) {}
Gradient::GradientColor::GradientColor():r(), g(0), b(0), a(0) {}
const Gradient::GradientColor & Gradient::GradientColor::operator+=(const GradientColor &lhs){
r += lhs.r;
g += lhs.g;
b += lhs.b;
a += lhs.a;
@gauravalgo
gauravalgo / sort notes of this lecture
Last active July 28, 2020 16:10
Undefined behaviour in the STL
refrence: https://www.youtube.com/watch?v=BEmAo6Fdg-Q
what does the undefined behaviour?
#include<stdio.h>
int x=100;
int left()
{
x++;
return x;
https://gist.github.com/NickBeeuwsaert/6258245
http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node5.html
@gauravalgo
gauravalgo / shading.h
Created July 22, 2020 14:43
gouraud shading #shading #graphics
https://www.youtube.com/watch?v=F4rZXZhUmkg
illumination model,
1) FLAT SHADING
2) INTENSITY INTERPOLATION SCHEME ---> GOURAUD SHADING
IT CONSISTS OF THREE STEPS
1) average normal unit vector
2)
@gauravalgo
gauravalgo / audio.cpp
Created July 20, 2020 12:35
audio dsp basics
1) synthesizing a tone
int createtone()
{
}
working on discrete signals
==================================
operations on discreate signals
1) Fllipping F[n] =F[-n]
2) Scaling F[n]=F[2*n] // samples are lost in
3) shifting a signal X[n-n0]= X[n-1] //start the signal with one usnit late or early
Shift , Flip and Scale
====================
4) X[-2n+3]
1) symmetry : f(r,thetha)==f(r,-thetha) then a curve is symmetrical about thetha i.e. theta = PI/2 or PI or ZERO.
curve is symmetrical about f(r,thetha)==f(-r,thetha) then curve is symmetrical about pole.
2) tangent to pole : a curve passing though pole is called tangent to pole.
r=a(1+cos(theta)).
putting r=0 whether the theta exixts if not then curve does not exists at r=0 else exists.
3) curve tracing : means for calcutes values of theta you have to trace the curve .
thetha= ZERO,PI/6,PI/4,PI/2,PI.
4) Asymptote: for which values of theta r becomes infinite.
5) tangent to the curve: tan(phai) = r / derivative(r,theta);
calculates the values of PHAI to evalutes .