Skip to content

wbabic/vector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vector

A clojure app for exploring linear algebra, differentioal equations and algorithms

Usage

lein repl

lein test

write graph data to file in edn format

references

Clojure edn walkthrough http://www.compoundtheory.com/clojure-edn-walkthrough/

edn-format https://github.com/edn-format/edn

API http://clojure.github.io/clojure/clojure.edn-api.html

clojure cookbook reading and writing clojure data https://github.com/clojure-cookbook/clojure-cookbook/blob/master/04_local-io/4-14_read-write-clojure-data-structures.asciidoc

notes

pr and prn print in a way that can be read by the clojure reader

introduction to quadratics

http://www.shelovesmath.com/algebra/intermediate-algebra/quadratics/ quadratic.clj

types of quadratic constructors:

  • paramaters a b c as a polynomial
  • vertex (h,k) leading cooefficent a
  • roots z1, z2, possibly complex

combine polynomial.clj and complex.clj with quadratic.clj

euclidean algorithm

the art of computer programming

euclid.clj

permutaions and combinations pascals triangle factorial integer partition combinatorics concrete programming tower of hanoi graphs loom visualizing algorithms

turning cats into dogs

https://jkkramer.wordpress.com/2010/08/27/fun-with-clojure%C2%A0turning-cats-into-dogs-in-hanoi/ https://gist.github.com/jkk/608728 http://codekata.com/kata/kata19-word-chains/ http://ubietylab.net/ubigraph/

wordchains.clj breadth-first search hanoi.clj

tower of hanoi

hanoi.clj

Concrete Mathematics

three pegs n discs initially stacked in decreasing size on one of the pegs transfer the entire tower from one peg to another, moving one disk at a time, never moving a larger onto a smaller

Each possible position in the game is a node. Nodes connect to each other via possible moves.

A moves function takes a game state and returns valid neighboring states.

polynomials

polynomial.clj

add and multiply polynomials

references

https://www.fpcomplete.com/user/Sam567/computational-physics/beginner-s-tools/polynomials https://courses.edx.org/courses/SchoolYourself/AlgebraX/1T2015/courseware/

http://en.wikipedia.org/wiki/Polynomial https://github.com/levand/prolin https://github.com/benzitohhh/hello-clojure/blob/master/src/hello_clojure/polynomial.clj https://github.com/clojure-numerics/expresso/blob/master/src/main/clojure/numeric/expresso/impl/polynomial.clj http://hoteljavaopensource.blogspot.com/2013/08/clojure-and-polynomials.html

http://en.wikipedia.org/wiki/Root-finding_algorithm

Fibonacci polynomials

Fibonacci and Lucas polynomials a generalization of Fibonacci and Lucas numbers http://en.wikipedia.org/wiki/Fibonacci_polynomials

Fibonacci Polynomials Fn(x) = 0 if n = 0 1 if n = 1 x*F(n-1)(x) + F(n-2)(x) if n >= 2

Lucas Polynomials Ln(x) = 0 if n = 2 1 if n = x x*L(n-1)(x) + L(n-2)(x) if n >= 2

Generating Functions Sum n=1 to infinity Fn(x)tn =t/(1 - xt - t^2) Sum n=1 to infinity Ln(x)tn =(2 - xt)/(1 - xt - t^2)

Lucas Sequences http://en.wikipedia.org/wiki/Lucas_sequence http://mathworld.wolfram.com/LucasSequence.html Fn = Un(x,-1) Ln = Vn(x,-1)

Identities

Closed Form Expression

Combinatorial Interpretaion 2x1 dominoes

http://oeis.org/A162515 http://oeis.org/A011973

De Moivre’s formula

http://en.wikipedia.org/wiki/De_Moivre%27s_formula

http://demonstrations.wolfram.com/DeMoivresTheoremForTrigIdentities/ http://en.wikipedia.org/wiki/Wolfram_Demonstrations_Project

enumerative combinatorics

http://en.wikipedia.org/wiki/Enumerative_combinatorics

the number of ways a certain pattern can be formed counting combinations counting permutations

the number of orderings of a deck of 52 cards is 52!

recurrence relation generating function

pascal’s triangle and binomial coefficients

pascal.clj

Pascal’s triangle C(n,k) using symmetry C(n,k) = C(n,n-k) from n = 0 to 100 k = 0 to floor(n/2) C(n,k) = 0 if n<0 or k>n

Catalan numbers

http://en.wikipedia.org/wiki/Pascal%27s_triangle http://en.wikipedia.org/wiki/Binomial_coefficient http://en.wikipedia.org/wiki/Binomial_theorem http://en.wikipedia.org/wiki/Binomial_series http://en.wikipedia.org/wiki/Generating_function http://en.wikipedia.org/wiki/Fibonacci_number #Closed-form_expression http://en.wikipedia.org/wiki/Recurrence_relation #Linear_homogeneous_recurrence_relations_with_constant_coefficients http://en.wikipedia.org/wiki/Characteristic_polynomial http://en.wikipedia.org/wiki/Catalan_number http://en.wikipedia.org/wiki/Enumerative_combinatorics http://en.wikipedia.org/wiki/Twelvefold_way

fibonacci numbers

calculate nth fibonacci directly using powers of phi exactly, keeping the root 5 in tact add, multiply, take nth powers of (1 +- root(5))/2 explore fibonacci properties

factorial

factorial.clj factorial lazy sequence falling-factorial choose n k

complex

complex.clj vector representation of a complex number add mult pow modulus argument mult-inverse

number

protocols Addition Multiplication Equality Evaluate Conjugate

root complex

series

series.clj sequence of partial sums reductions

formal power series

fps.clj

add two fps take cauchy product of two series

generating functions

generating.clj transduce.clj

simple sequnces and their generatiing functions transducers

Concrete Mathematics clojure.org/transducers

generating functions 1 z^m 1/(1-z) e^z (1+z)^n

compositions

operations on fps sum product compose with a c*z mult-by-z differentiate integrate mult by 1/(1-z) drop first m-1 terms

an algebra of formal power series

hypergeometric function

http://en.wikipedia.org/wiki/Hypergeometric_function generalized http://en.wikipedia.org/wiki/Generalized_hypergeometric_function

pochhammer symbol http://en.wikipedia.org/wiki/Pochhammer_symbol

Higher Transcendental Functions Harry Bateman vol1 pdf http://apps.nrbook.com/bateman/Vol1.pdf numenor:~/dev/math/bateman-Vol1.pdf Gamma function, Hypergeometric function, Legendre functions, Generalized Hypergeometric series, Confluent Hypergeometric function http://apps.nrbook.com/bateman/Vol2.pdf Bessel functions http://apps.nrbook.com/bateman/Vol3.pdf Automorphic functions, Lame functions, Mathieu functions, Spheroidal wave functions, Ellipsoidal wave functions, Functions of number theory, Generating functions

http://www.encyclopediaofmath.org/index.php/Hypergeometric_function http://mathworld.wolfram.com/HypergeometricFunction.html

Computation of Hypergeometric Functions John Pearson Worcester College http://people.maths.ox.ac.uk/porterm/research/pearson_final.pdf numenor:~/dev/math/pearson_final.pdf MATLAB, double precision

books I have: Henrici Whittaker, Watson Arfken Courant, Hilbert Graham, Knuth Knuth, Art of Programming, Vol1

books I want: Knuth, Art of Programming, Vol2

mathematicians Euler Gauss Kummer Riemann Schwarz

funcool cats

https://github.com/funcool/cats http://funcool.github.io/cats/latest/ [funcool/cats “1.2.0”] (require ‘[cats.builtin]) (require ‘[cats.core :as m]) (require ‘[cats.monad.maybe :as maybe])

affine coordinates

make distinction between points and vectors conformal affine transformations of the plane implemented as matrices translatation, rotation, uniform scaling (about a point) in the affine plane compose via matrix multiplication

points trnslate vectors do not

affine transforms apllied to points and vectors

homogeneous coordinates

ideas from the following which has references: http://www.mat.ucsb.edu/594cm/2010/Week1/homog-coords.pdf

as a basis for projective geometry to project a three dimensional scene onto a two dimensional image plane

implemented in affine/transflorms2d.clj

references

loom

https://jkkramer.wordpress.com/2010/08/27/fun-with-clojure%C2%A0turning-cats-into-dogs-in-hanoi/ https://gist.github.com/jkk/608728 https://github.com/aysylu/loom http://aysy.lu/loom/loom.graph.html#var-Graph

sierpensky and apollonian gaskets

http://en.wikipedia.org/wiki/Sierpinski_triangle http://en.wikipedia.org/wiki/Apollonian_gasket

cut the knot

http://www.cut-the-knot.org/triangle/Hanoi.shtml

fractals

fractal nature http://users.math.yale.edu/users/mandelbrot/web_pdfs/encyclopediaBritannica.pdf

clojure libs

http://clojure.github.io/math.numeric-tower/ https://github.com/clojure/math.combinatorics

books

art of computer programming concrete mathematics book of numbers intro to algorithms sequnces and series applied and computational complex analysis

combinatorics

http://en.wikipedia.org/wiki/Generating_function http://en.wikipedia.org/wiki/Enumerative_combinatorics http://en.wikipedia.org/wiki/Partition_%28number_theory%29#Ferrers_diagram

graphviz

http://www.graphviz.org/content/attrs https://github.com/daveray/dorothy https://github.com/ztellman/rhizome

Basic Graph Drawing http://www.graphviz.org/Documentation/dotguide.pdf

Gallery http://www.graphviz.org/Gallery.php

CSS grids

https://css-tricks.com/dont-overthink-it-grids/ http://codepen.io/chriscoyier/pen/eGcLw

computer graphics

from http://www.mat.ucsb.edu/594cm/2010/Week1/homog-coords.pdf

Riesenfeld, R.F. Homogeneous Coordinates and Projective Planes in Computer Graphics. IEEE Computer Graphics and Applications 1 (1), Jan., 1981, pp. 50-55.

Penna, M.A., Patterson, R.R. Projective Geometry and its Application to Computer Graphics. Prentice Hall, Englewood Cliffs, N.J., 1986.

Kantani, K. Computational Projective Geometry. Computer Vision, Graphics, and Image Processing 54, 1991.

Herman, I. The Use of Projective Geometry in Computer Graphics. Lecture Notes in Computer Science 564, Springer Verlag, 1991.

Coxeter, H.S.M. Projective Geometry (second edition), Springer-Verlag, New York, 1987.

Blinn, J. A Trip down the Graphics Pipeline: the Homogeneous Perspective Transform. IEEE Computer Graphics and Applications. May, 1993, pp. 75-80.

License

Copyright © 2015 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

an exploration into clojure programming and mathematics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published