matrix

Determine transformation matrix

As a followup to my previous question about determining camera parameters I have formulated a new problem. I have two pictures of the same rectangle: The first is an image without any transformations and shows the rectangle as it is. The second image shows the rectangle after some 3d transformation (XYZ-rotation, scaling, XY-translati...

Transformation (rotation) of image using matrix - design-time vs. run-time rendering results

Hi, I have a 48x48 image which is rotated using a transformation matrix. For some reason, the rotated image in design-time differs from the rotated image in run-time as you can see from this screenshot (design-time on the left, run-time on the right): It might be a little bit difficult to spot, but if you look closely at the right e...

Parent-Child Constraints

Example: var circle1 :Canvas = new Canvas(); var circle2 :Canvas = new Canvas(); circle1.addChild( circle2 ) circle1.scaleX = 2; After the example before when Flash will render circle2 because it is child to circle1 it will be scaled to. Is there a way I can scale circle1 without affect circle2 or what can I do to circle2 so it can h...

Is there an equivalent of Matrix(RectangleF rect, PointF[] plgpts) in System.Windows.Media (WPF)

Hello, I will use this constructor Matrix(RectangleF rect, PointF[] plgpts) in System.Drawing.Drawing2D (which take a rectangle in parameter) in a wpf app but I don't find the equivalent in System.Windows.Media.Matrix. I'm not masterize matrix and this constructor is very easy to use. Is there an other solution ? Many thanks ...

How can I use Scheme/Lisp/Clojure for Matrix/LP problems?

I need to perform numerical analysis like that supported by MatLab or NumPy. Is there a good library that is supported by Scheme/Lisp/Clojure(Java)? I don't want to leave my round braces. Thanks a lot. ...

Accessing values using subscripts without using sub2ind

Consider a matrix M and a set of subscripts stored in columns I and J. I need to access the elements designated by I & J without converting them to linear indices (i.e. using sub2ind). E.g. M = [1 2 3;4 5 6;7 8 9]; I = [1 1 1]; J = [1 2 3]; VALS = [1 2 3]; Also, doing the following is not feasible since I & J are huge : VALS = diag(...

GLSL extracting modelmatrix from modelviewmatrix and viewmatrix

hello, since in GLSL the modelmatrix is not available, i was wondering if it is possible to get it programatically from the gl_ModelViewMatrix and the "viewmatrix" which i would pass as a uniform? if yes, how? thank you! ...

inverting a 4x4 matrix

hello, i am looking for a sample code implementation on how to invert a 4x4 matrix. i know there is gaussian eleminiation, LU decomposition, etc. but instead of looking at them in detail i am really just looking for the code to do this. language ideally C++, data is available in array of 16 floats in cloumn-major order. thank you! ...

matrix multiplication

let's say we have the following matrix multiplication: A = B * C where A,B,C are square (NxN) matrices. how can i get B from the above statement? is it: B = C^-1 * A or B = A * C^-1 or something else??? (where C^-1 is the inverse matrix.) thanks! ...

How to use custom classes in expressions like math objects?

I have noticed that it is possible to define a custom class and then use operators like +,-,/ and * on a number of them rather than using methods to do so. For example, I created a Matrix class that does complex matrix algebra/differentiation and created it so that all the operations were controlled by methods: Matrix m1 = new Matrix(ne...

Create a matrix/table from a LEFT JOIN in SQL

I'd like to know a good solution for converting a LEFT JOIN into a table/matrix. For example, given this schema: objects id (integer) name (string) attributes id (integer) object_id (integer) name (string) value (string) And these values: 1,ball 2,box 1,1,colour,red 2,1,shape,sphere 3,1,material,rubber 4,2,colo...

Lapack's row reduction

Hello! I am trying to write a function that produces a single solution to an underrepresented system of equations (e.g. the matrix that describes the system is wider than it is tall). In order to do this, I have been looking in the LAPACK documentation for a way to row-reduce a matrix to it's reduced-echelon form, similar to the functio...

Most mature sparse matrix package for R?

There are at least two sparse matrix packages for R. I'm looking into these because I'm working with datasets that are too big and sparse to fit in memory with a dense representation. I want basic linear algebra routines, plus the ability to easily write C code to operate on them. Which library is the most mature and best to use? So ...

How do you multiply a matrix by itself?

This is what i have so far but I do not think it is right. for (int i = 0 ; i < 5; i++) { for (int j = 0; j < 5; j++) { matrix[i][j] += matrix[i][j] * matrix[i][j]; } } ...

Decompose complex matrix transformation into a series of simple transformations?

I wonder if it is possible (and if it is then how) to re-present an arbitrary M3 matrix transformation as a sequence of simpler transformations (such as translate, scale, skew, rotate) In other words: how to calculate MTranslate, MScale, MRotate, MSkew matrices from the MComplex so that the following equation would be true: MComplex = ...

How can I alter the values of an transform?

For example, I can access them like this: self.layer.transform.m32 but I can't assign a value to it, like self.layer.transform.m32 = 0.3f; it says invalid assignment. But shouldn't that actually work? struct CATransform3D { CGFloat m11, m12, m13, m14; CGFloat m21, m22, m23, m24; CGFloat m31, m32, m33, m34; CGFloat m...

Determining if a matrix is diagonalizable in the R Programming Language

I have a matrix and I would like to know if it is diagonalizable. How do I do this in the R programming language? ...

Maya .ma matrix scale translation

A perhaps slightly off-topic subject, but Maya is giving me serious grief on a specific scale translation matrix transformation, and I have nowhere else to turn. Everything works fine with my Maya .ma (Maya ASCII) importer until Maya descides to add an .spt attribute (typically setAttr ".spt" -type "double3" 1 2 3 ;). From this somewhat...

System.Drawing.Matrix, I understand what it does, but how does it work?

I've used the Matrix class a thousand times. I have an elementary grasp of matrix mathematics, it's been years since I've had a class on the subject. But I don't fully understand what this class is doing under the hood to manipulate the points in a GraphicsPath. What, specifically, is it doing in there as it pertains to GraphicsPaths i...

How to Sum Column of a Matrix and Store it in a Vector in C++

Is there a straight forward way to do it? I'm stuck here: #include <iostream> #include <vector> #include <cstdlib> using std::size_t; using std::vector; int main() { vector<vector<int> > Matrix; //Create the 2x2 matrix. size_t rows = 2; size_t cols = 2; // 1: set the number of rows. Matrix.resize(rows); for(size_t...