Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dheeraj120501 committed Mar 20, 2023
0 parents commit 47d4267
Show file tree
Hide file tree
Showing 23 changed files with 2,342 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
20 changes: 20 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Introduction

This repo contains the visualizations of some algorithms, physics and stuffs i like ;P.

# Table of contents

| S/No. | Name |
| ----- | ------------------------------------------------------------- |
| 1. | [Solar System Simulation]() |
| 2. | [A\* Path Visualization]() |
| 3. | [Djikstra's Shortest Path Finding Visualization]() |
| 4. | [Fractals]() |
| 5. | [Random Number Generation]() |
| 6. | [Boid Algorithm]() |
| 7. | [Fourier Transform]() |
| 8. | [Locating Points on Sphere and Satellite Navigation System]() |
| 9. | [Chaos Theory & Logistic Map ]() |
| 10. | [OODA Loop]() |
| 11. | [Data Compression]() |
| 12. | [Game of Life]() |
| 13. | [Maze World]() |
| 14. | [Random Walk]() |
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "simulations-and-visuals",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.5.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.2.0"
},
"type": "module"
}
12 changes: 12 additions & 0 deletions src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}

export {};
12 changes: 12 additions & 0 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
1 change: 1 addition & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Visualizations and Simulations</h1>
47 changes: 47 additions & 0 deletions static/docs/A star/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Introduction

It is a searching algorithm that is used to find the shortest path between an initial and a final point.

A\* was initially designed as a graph traversal problem, to help build a robot that can find its own course. It still remains a widely popular algorithm for graph traversal.

It is an extension of Dijkstra’s shortest path algorithm (Dijkstra’s Algorithm). The extension here is that, instead of using a priority queue to store all the elements, we use heaps (binary trees) to store them.

The A\* Search Algorithm also uses a heuristic function that provides additional information regarding how far away from the goal node we are. This function is used in conjunction with the f-heap (Fibonacci heap) data structure in order to make searching more efficient.

It searches for shorter paths first, thus making it an optimal and complete algorithm.

- An optimal algorithm will find the least cost outcome for a problem.
- A complete algorithm finds all the possible outcomes of a problem.

# Working

Initially, the Algorithm calculates the cost to all its immediate neighboring nodes,n, and chooses the one incurring the least cost. This process repeats until no new nodes can be chosen and all paths have been traversed. Then, you should consider the best path among them. If f(n) represents the final cost, then it can be denoted as :

f(n) = g(n) + h(n), where :

g(n) = cost of traversing from one node to another. This will vary from node to node

h(n) = heuristic approximation of the node's value. This is not a real value but an approximation cost

Calculating g is not a big deal but to calculate h we can:

1. Calculate the exact value of h (which is certainly time consuming).
1. Approximate the value of h using some heuristics (less time consuming).
- Manhattan Distance
- Diagonal Distance
- Euclidean Distance

We can also think of Dijkstra as a special case of A\* Search Algorithm, where h = 0 for all nodes.

# Complexity Analysis

TIME COMPLEXITY: O(E), where E is the number of edges in the graph
SPACE COMPLEXITY: O(V), where V is the total number of vertices.

# Limitations

A major drawback of the algorithm is its space and time complexity. It takes a large amount of space to store all possible paths and a lot of time to find them.

Although being the best path finding algorithm around, A\* Search Algorithm doesn’t produce the shortest path always, as it relies heavily on heuristics / approximations to calculate – h

A heuristic algorithm sacrifices optimality, with precision and accuracy for speed, to solve problems faster and more efficiently.
21 changes: 21 additions & 0 deletions static/docs/Data Compression/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Introduction

In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation.

Any particular compression is either lossy or lossless.

- Lossless compression reduces bits by identifying and eliminating statistical redundancy.

- No information is lost in lossless compression.
- PNG images use lossless compression.

- Lossy compression reduces bits by removing unnecessary or less important information.

- JPEG images can and often do use lossy compression.

A device that performs data compression is referred to as an **encoder**, and one that performs the reversal of the process (decompression) as a **decoder**.

Compressed files usually end with .zip, .sit and .tar. These are called extensions, and they indicate different compression formats--different types of software used to compress files.

- For PCs, .zip is most common, .sit is used often with Macs and .tar used with Linux. When you see a file with one of these extensions, it may be either a single large file or a group of files bundled together.
- Files ending in .sea or .exe are called **self-extracting files**. These are compressed files that do not require any special software to decompress.
9 changes: 9 additions & 0 deletions static/docs/Fractals/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Introduction

- Self Similarity
- Fine Shape at small scale
- Reccursive Defination

# Koch Curve

# Stocastic Fractals
3 changes: 3 additions & 0 deletions static/docs/Game of Life/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Introduction

# Cellular Automaton
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Different types of Navigation systems

Automotive navigation system

Marine navigation systems using sonar

Satellite navigation system

- Global Positioning System, a group of satellites and computers that can provide information on any person, vessel, or vehicle's location via a GPS receiver
- GPS navigation device, a device that can receive GPS signals for the purpose of determining the device's location and possibly to suggest or give directions
- GLONASS, satellite navigation system run by Russia
- Galileo global navigation satellite system
- IRNSS, regional satellite system run by India.

Surgical navigation system, a system that determines the position of surgical instruments in relation to patient images such as CT or MRI scans.

Inertial guidance system, a system which continuously determines the position, orientation, and velocity (direction and speed of movement) of a moving object without the need for external reference

Robotic mapping, the methods and equipment by which an autonomous robot is able to construct (or use) a map or floor plan and to localize itself within it

XNAV for deep space navigation
Loading

0 comments on commit 47d4267

Please sign in to comment.