Skip to content

Instantly share code, notes, and snippets.

View krantikal's full-sized avatar

krantikal

View GitHub Profile
@krantikal
krantikal / cleangif.cmd
Created April 4, 2021 18:22
[Image Manipulation] #photo #pix #image
@echo off
:: make gif transparent ...
:: cleangif img.gif ...
:: produces img_clear.gif ...
:: uses im convert ...
:: Shiva, Feb 12, 2018 ...
magick convert %1.gif -fuzz 10% -transparent white %1_clear.gif
@krantikal
krantikal / 0Readme.md
Last active April 2, 2021 06:08
[Physics Module Sample Coordsys Python] #demo #sample #math

coordsys.py

It is a simple module (developed for illustrative purposes) with functions for converting between radians and degrees and also between spherical and cartesian coordinates)

Shiva, 2014

@krantikal
krantikal / vecprojQP.py
Last active April 2, 2021 06:03
[Vector Projection Python] Problem #physics, #math,#QP,#SOL #pylab
# Testme\aacode\MidsemSolP1.py ; also contains ipynb
from pylab import *
# Construct arrays for two vectors given as a: (1,2,4) and b: (1,1,3)
# Find the component of a parallel to b
# Express a as a sum of vectors parallel and perpendicular to b
a=array([1,2,4])
b=array([1,1,3])
@krantikal
krantikal / maximafacts.md
Last active October 25, 2023 03:09
[WX Maxima] facts #scicmp #cas #housekeeping

Maxima: Housekeeping facts

Autocomplete

  1. ctrl + k autocompletes, e.g sol ctrl+k
  2. shift + ctrl + k shows usage as well, e.g sol shift + ctrl +k

Greek vars

esc a esc gives you alpha (greek). Can be used as var name.

@krantikal
krantikal / 0Readme.md
Created April 2, 2021 05:19
[LaTeX Code Inclusion] #housekeeping
@krantikal
krantikal / incfigs.tex
Created April 2, 2021 05:12
[LaTeX Graphics Inclusion] #housekeeping
LaTeX includegraphics
%% Graphics Path
In Preamble:
\graphicspath{ {./pix/} }
%% Forms that this command taketh
\includegraphics[scale=1.5]{lion-logo}
\includegraphics[scale=1.2, angle=45]{lion-logo}
@krantikal
krantikal / socbib.tex
Created April 2, 2021 05:09
[LaTeX Refs] #housekeeping
LaTeX Bibliography
Dear Socratis,
See \cite{verma} and \cite{poschel}....
........
\begin{thebibliography}{100} %Assuming maximum 100 entries not more
\bibitem{poschel} \textbf{Pöschel, Thorsten, and Schwager, Thomas. \textit{"Molecular Dynamics". Computational Granular Dynamics: Models and Algorithms.}} Springer-Verlag Berlin Heidelberg (2005)
\bibitem{verma} \textbf{Verma, H C. \textit{"Rotational Mechanics". Concepts of Physics [Part 1].}} Bharati Bhawan (P \& D) (2012).
\end{thebibliography}
@krantikal
krantikal / multiwin.plt
Last active April 2, 2021 04:51
[Gnuplot Effects] Docked Multi-window #plotting #housekeeping
# Docked Gnuplot windows
# Plots share space with code window
# If there are more than one plot, they will be stacked
set term win docked
plot sin(x)
set term win 2 docked
plot sin(x)+cos(x)
@krantikal
krantikal / animdata.plt
Created March 31, 2021 17:29
[Gnuplot Animation] Creating #animation in our favorite #plotting system
# output gif is must
set terminal gif animate delay 100
set output 'output.gif'
stats 'data.dat' nooutput
set xrange [-0.5:1.5]
set yrange [-0.5:5.5]
#do for [i=1:int(STATS_blocks)] {
# plot 'data.dat' index (i-1) with circles
@krantikal
krantikal / myplus.m
Last active September 9, 2022 03:06
[Matlab Custom function] #demo #sample Matlab function file for #astrophyics #coursework
function y = myplus( x,y )
%myplus returns the sum minus the product of the two input variables.
y = x+y - x.*y;
end