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 / Eigen Cheat sheet
Created July 6, 2019 11:00 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.
@gauravalgo
gauravalgo / gist.cpp
Created January 11, 2020 16:22
test #c++
#include<iostream>
using namespace std;
int
main()
{
return 0;
}
@gauravalgo
gauravalgo / Intersection_line_plane.cpp
Last active February 29, 2020 20:25
#geometry #cgal #c++
#include<iostream>
using namespace std;
void intersection_between_plane_line_segment()
{
Point_3 p1(1,2,3),p2(-1,2,3),p4(-2,-2,4);
Point_3 l1(5,6,7),l2(-1,2,-2);
CGAL::Origin o;
Plane_3 p3(p1,p2,p4);
Vector_3 v0 =Vector_3(o,p1);
std::cout<< "vector 0 "<<v0 <<std::endl;
@gauravalgo
gauravalgo / Distance_between_a_point_and_a_line_given_a_vector_parellel_to_a_line.cpp
Created February 29, 2020 20:34
#c++ #cgal #eric_lengyal #foundations_of_game_engine
void distance_from_a_point_to_a_line(const Vector_3& vector_to_a_line,Point_3& p,Point_3& q)
{
Vector_3 Perpendicular_vector=CGAL::cross_product(Vector_3(p,q),vector_to_a_line);
std::cout<<"distance_from_a_point_to_a_line"<<std::sqrt(Perpendicular_vector.squared_length()/vector_to_a_line.squared_length())<<std::endl;
}
@gauravalgo
gauravalgo / skew_lines_two_lines_lie_in_diffrent_planes_in_3D__find_the_closest_diatance_between_them.cpp
Last active February 4, 2021 11:35
#c++ #cgal #closest distance between a Line to a line (SKEW LINES) #Geometry
//two lines lie in different plane given by equations
//1) p1+t1*v1
//2) p2+t2*v2
//for these parametric equations we need to find the closest distance between two lines assume that the closest distance is given by the line
//perpendicular to both these vector v1,v2.
//[(p2+t2*v2-p1-t1*v1)*v1=0]
//[(p2+t2*v2-p1-t1*v1)*v2=0]
//calculating t1 and t2 we just have to d=eq(2)-eq(1);
//m11=v1*v1 m21=-v1*v2
//m12=v1*v2 m22=-v2*v2
@gauravalgo
gauravalgo / CloudsResources.md
Created June 19, 2020 11:22 — forked from pixelsnafu/CloudsResources.md
Useful Resources for Rendering Volumetric Clouds

Volumetric Clouds Resources List

  1. A. Schneider, "Real-Time Volumetric Cloudscapes," in GPU Pro 7: Advanced Rendering Techniques, 2016, pp. 97-127. (Follow up presentations here, and here.)

  2. S. Hillaire, "Physically Based Sky, Atmosphere and Cloud Rendering in Frostbite" in Physically Based Shading in Theory and Practice course, SIGGRAPH 2016. [video] [course notes] [scatter integral shadertoy]

  3. [R. Högfeldt, "Convincing Cloud Rendering – An Implementation of Real-Time Dynamic Volumetric Clouds in Frostbite"](https://odr.chalmers.se/hand

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 .
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]