Skip to content

Instantly share code, notes, and snippets.

@Evgenij-Gr
Evgenij-Gr / Mapping from plane coordinates to image pixels
Last active August 29, 2015 13:57
Suppose that we have an image on the plane, which borders are parallel to coordinate axis. This procedure does the mapping from plane coordinates to pixels of image.
#! /usr/bin/python
# We lay sides of image parallel to axi of planes
# Bigger side of image maps to bigger side of rect
# On images we always have X ~ Width, Y ~ Height (it is true for OpenCV)
def PlaneToImage(Point, LTCorner, RBCorner, resW, resH):
assert(not resW==resH)
if (resW > resH):
if (abs(LTCorner[0]-RBCorner[0]) > abs(LTCorner[1]-RBCorner[1])):
OnImgX, OnImgY = 0, 1
@Evgenij-Gr
Evgenij-Gr / simple_checks.py
Created January 3, 2015 09:19
Simple check for transversality of vector field along straight line or curve. Check is based on mean value theorem: if there are points where scalar product of vector field with normal field have different signs, then exists a point of non-transversality.
import numpy as np
import math as m
# we assume that line is parameterized by values from segment [0, 1] placed uniformly
# startPoint, endPoint - 2D point
# nSteps - integer value
# vectorField - function that takes 2D point and return 2D vector
def checkStraightLineForTransversality(startPoint, endPoint, nSteps, vectorField):
tangentVector = endPoint - startPoint
normalVector = np.array([-tangentVector[1], tangentVector[0]])
@Evgenij-Gr
Evgenij-Gr / np_plots.py
Last active August 29, 2015 14:27
Simple routines that imitate MATLAB-style "easy plotting" commands.
import numpy as np
import math as m
# calculates point of parameterized curve
# accepts parameterization interval, parameterization function
# and discretization step
def ezLinePlot(Boundaries, CurveParametrization, Steps):
left, right = Boundaries
curveParamPoints = np.linspace(left, right, Steps)
curvePoints = [CurveParametrization(t) for t in curveParamPoints]
@Evgenij-Gr
Evgenij-Gr / Rodrigues_sequence
Created November 8, 2016 08:36
Rodrigues_sequence
Первое преобразование
$$ e'_{x/y/z} = {\rm Rodr}_{\langle \phi_1, e_z \rangle} (e_{x/y/z}) $$
$$ v' = {\rm Rodr}_{\langle \phi_1, e_z \rangle} (v) $$
Второе преобразование
$$ e''_{x/y/z} = {\rm Rodr}_{\langle \phi_2, e'_y \rangle} (e'_{x/y/z}) $$
$$ v'' = {\rm Rodr}_{\langle \phi_2, e'_y \rangle} (v') $$
@Evgenij-Gr
Evgenij-Gr / pcolormesh.ipynb
Created November 21, 2016 05:43
Describes in what order fill matrix to correctly use with pcolormesh
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Evgenij-Gr
Evgenij-Gr / equivariance-check.ipynb
Created March 6, 2017 22:00
Simple demonstration of using SymPy for checking dynamical systems equivariance conditions in simple examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Evgenij-Gr
Evgenij-Gr / DS-ND-conferences-2019.md
Last active February 26, 2019 04:58
European dynamical systems, nonlinear dynamics and ODEs conferences in 2019
@Evgenij-Gr
Evgenij-Gr / DS-ND-conferences-2020.md
Created February 13, 2020 18:50
Conferences in 2020

January

Conference name

Website: address

Where: city, country

When: Month Days, Year