Skip to content

Instantly share code, notes, and snippets.

View AryanGitHub's full-sized avatar
🛴

Aryan Pandey AryanGitHub

🛴
  • mars
View GitHub Profile
@AryanGitHub
AryanGitHub / Read_Me.md
Created December 26, 2022 13:00
Perspective Projection

Perspective Projection is used for representing a three-dimensional scene in a two-dimensional medium, like Computer Screen. So how do we do it? Image1

Here we are assuming everything is happening behind our Near plane or "the computer screen", in a Viewing frustum. So this provides the appearance that the farther away object is from the viewer, the smaller it appears.

As the final target is to map a 3D coordinate (x,y,z) to a 2D coordinate (x,y). Image2

@AryanGitHub
AryanGitHub / DFA.py
Created June 5, 2023 10:32
DFA using python3
# https://en.wikipedia.org/wiki/Deterministic_finite_automaton
class DFA: #Deterministic Finite Automaton
def __init__ (self ,states : set , alphabets : set, transition_function , initial , accepted_states : set):
self.states = states
self.alphabets = alphabets
if (self.__checkTransitionFunction__(transition_function)):
self.transitionFunction = transition_function
@AryanGitHub
AryanGitHub / chapter_1.md
Created June 8, 2023 17:43
Generics in Java
  1. Boxing and Unboxing can make programs faster when used correctly.

Take this example!

public static int sum (List<Integer> ints) {
	int s = 0;
	for (int n : ints) { s += n; }
	return s;
}
@AryanGitHub
AryanGitHub / DayTimeClient.java
Last active October 4, 2023 18:33
Computer Network Lab Programs
import java.util.*;
import java.net.*;
import java.io.*;
public class lab5DayTimeClient{
public static void main (String args[]) throws Exception {
Socket soc = new Socket("localhost" , 1300);