Linear Algebra usage in programming [closed] - linear-algebra

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I am starting to learn Linear Algebra but it is has been very mathematical and I don't know its actual usage in programming. I heard it is a very useful subject for movements(animate) and graphics. I thought I could make my learning process for linear algebra more fun if I could learn it from its application through programming. That's learn through the practical way and not just working out on paper.
Since I am still learning the very basics of linear algebra, I am thinking where and how are basic concepts of linear algebra used in programming? What kind of interesting things could be done with basic knowledge of linear algebra such as row-echelon form, LU deposition, linear combination/system, etc. Any tutorials on any languages such as Java, Actionscript, PHP or others teaching the usage of basic linear algebra concepts to create interesting simple things?
Thanks!

Matrices and their transformations are used for positioning, rotating and scaling elements in Flash, IOS and Android. Check out transformation matrix wiki, android api, and a cool flash tutorial

As you've already stated, the most likely place that you'll find it is in graphics and games programming. You don't say what language you'd like to program in, so I'll assume Java:
http://www.java3d.org/
All techniques are not created equal. You will use LU decomposition and eigenvalues more if you're doing scientific computing.
This is a very good book. Don't be fooled by the date: the mathematics haven't changed. I'd also recommend looking at OpenGL.

All the simple graphice are made with the use of linear algebra...
Make a new console project nd try your skills...

Probably the most important application of linear algebra in programming is Modular Arithmetic.
As for the examples you've provided, the relationship is quite reversed. Programming is used to implement those algorithms, the algorithms are not used for general programming.

Related

Free software for mathematical modeling. Is R a good one? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for a free software for mathematical modeling.
Here is a list of things I might be willing to achieve with this software: Integrating functions, solving differential equations, graph theory, analyzing infinite series, local stability analysis, Taylor series, get eigenvectors, compute the long term behaviour of a system of equations, etc...
Here is a related SE post. I am surprised that nobody is suggesting R. I am currently a R user and already use R for graph theory. Therefore I would appreciate to use R also to make other mathematical modeling. Is R less efficient that Sage, SimPy, Mathematica and others for mathematical modeling? Why? Do you know a manual providing exaplanation for how to make mathematical modeling with R?
Thank you
Sounds like R is your first way to go. It does not make to good sense to compare R with any other tool in such a braod way you are asking for. R packages differ largely in efficiency, some are in fact C tools while others are written in the R language. As a start R can hardly be any wrong and is free.
Matlab might be a stable alternative, Julia is rising but still pre alpha.

Which branch applies more to programming: Calculus or Linear Algebra [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm a comp sci student and I need to fill out my math electives. Which would apply more to programming and computer science? Hell, which would be more useful altogether?
Elementary Calculus or Linear Algebra?
There are both second tier classes (level two) and I can only choose one.
If it boils down to a coin toss, I'll go with which ever fits into my schedule better... But really, I'd like to know which is best...
Thanks!
I have spent more than a decade working in very advanced linear algebra, so you might think I would recommend linear algebra. In fact, I recommend calculus. The reason is simple: if someone hasn't learned linear algebra, I can teach them the basics very quickly, assuming they already know calculus. If they haven't mastered calculus, they wouldn't be as competitive for a job and they wouldn't know enough to begin a lot of different optimization methods, which can be applicable to many types of functions, not just those that arise in typical linear algebra manipulations. Teaching the methods of calculus simply takes a lot more time and effort than that for linear algebra, at least at the level of a basic education.
Throw a coin because they both are.
You could assign to one but, attempt two.
Linear Algebra is more immediately applicable in a computational setting, but the distinction is very slight, and I think you'll get more value overall from learning calculus (and even that's a line-call).
I think you'll find more beneficial knowledge in linear algebra. Calculus will be more likely applicable to an Engineering setting, but linear algebra can come into play in many programming endeavors. Particularly in Video Game development, where most young programmers aspire to be :-)
In my experience, Linear Algebra if you go into graphics, otherwise neither. You mileage may vary

Application for solving linear system of equations [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I needed an application for solving linear systems of equations (N up to 10), so I got different codes, and compile them, and they seem to work, but I get lots of problems with precision. I mean, the solvers are really very sensitive to small changes of the system.
So, could somebody recommend to me a reliable commandl ine application for this purpose? Or some useful open source code (and easy to compile)
Thanks
GNU Octave is essentially a free version of Matlab (the syntax is identical for basic operations), so you can try things out there and see how they compare to the answers that you're getting.
Having said that, if your answer is very sensitive to the input, it's possible that your problem is ill-conditioned - you can check this by computing the condition number of the matrix in Octave. It's hard to say what to do in that case without knowing more specifics on the problem.
Also, you don't mention which method you're currently using. Gaussian elimination (i.e. "what you learned in math class") is notoriously numerically unstable if you don't use pivoting (see the wikipedia entry for "Pivoting"); adding that might be enough to improve the quality of the results.
An approach is to use the numpy package in Python. You can create a 2d matrix A and a 1d vector b, then solve Ax=b for x using solve(A, x). It's part of the linalg subpackage of numpy.

Vector Education [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Does anyone know where I could get a rundown of the vector math I'd need in order to program a raytracer? I could use a refresher of linear algebra and multivar calc since it's been a few years since I've taken those classes.
Good linear algebra books are terse at best, and would probably be overkill. A good 3D programming textbook might be more to the point. They'll have enough theory to get you through the math, and enough application to get you through the code.
There are plenty of free, online courses around. Some are specifically for 3D graphics programming. You might also take a look at NeHe's OpenGL tutorials.
If your brave, you could even look through the POV-Ray source.
Good luck.
Linear algebra is wonderful, and certainly appropriate here, but vectors in 3D space are a subset of general vector spaces.
I think something like Vector Math Tutorial for 3D Computer Graphics looks more appropriate.
i liked this book when i taught a computer graphics course: http://math.ucsd.edu/~sbuss/MathCG/
3D Computer Graphics:
A Mathematical Introduction with OpenGL
Author: Samuel R. Buss
This is the homepage for the book 3D Computer Graphics: A mathematical approach with OpenGL, by Sam Buss, Cambridge University Press, 2003. This book provides a mathematical introduction to 3D Computer Graphics at the advanced undergraduate or introductory graduate level.
* Table of contents: HTML or more complete contents as PDF. (Pagination has changed for the actual version.)
* Sample OpenGL programs
* Ray Trace software. Release 3 is now the standard version. NEW: Supports .NFF and .OBJ files. Uses kd-tree acceleration.
* Figures from the book. All figures in postscript and PDF formats.
* Errata page. List of known errata. Please email new errata to me at sbuss#ucsd.edu.

How to learn R as a programming language [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'd like to know how to learn the R language as as 'programming' language as opposed to learning it as a statistical system. My question is prompted by lack of understanding of such functions as parse, eval, etc. which may not find frequent use by an R user with a 'statistics' persuasion.
Edit: I've been exploring such tools like Rpy RSPerl rJava and wish to (at the very least) be able to understand concepts that facilitate R's communication with other programming languages.
The availability of Web applications for R (R-PHP, RApache, etc.) is another motivationg factor for me to gain a deeper, more structural understanding of R.
Last but not the least, I'd like to be able to write R packages for which such understanding would be beneficial if not necessary.
For starters, you might want to look at this article by John Cook. Also make sure that you read "The R Inferno".
There are many good resources on the R homepage, but in particular, read "An Introduction to R" and "The R Language Definition".
Some very closely related stackoverflow questions:
books-for-learning-the-r-language.
what-are-some-good-books-web-resources-and-projects-for-learning-r
suggestions-on-way-resources-to-start-learning-statistical-language-r
My favorite book on the subject: "Software for Data Analysis: Programming with R", by John Chambers, the creator of the S language.
(source: springer.com)
A good book for learning R-as-a-programming-language (as opposed to R-for-statistics) is The Art of R Programming, by Norman Matloff.
It's very readable, doesn't assume you're a computer scientist, and is quite inexpensive as R books go.
I would rather suggest a good and comprehensive start, like The R Book by Michael Crawley. It's an easy-to-read and complete book on R core functions, with statistical tips and a few exercises. It focuses a lot on R strengths (e.g. linear models) and gives also useful coding tricks. It helped me a lot while I was struggling on cryptic online courses.
I'm a very hands-on learner, so this advice may be specific to my learning style. I would suggest that the best place to start "learning to program" in any language involves finding problems outside of your normal range of experience and then trying to solve them using a programming language.
The projects that taught me the most about how to program with R had nothing to do with statistics at all.
Knowing functions like parse() and eval() is by no means a measure for being "a good R programmer". Applications that require heavy use of these functions do not make up a majority of the problem space in which you can apply R. Instead, I think you should try to be "a good programmer" who knows R. This involves refining your problem-solving approaches.
Programming is not a spectator sport-- a good book is indispensable as a reference on the tools available, but you need to find some problems upon which to hone your skills.

Resources