Questions tagged [diagonal]

Diagonal means either a diagonal matrix (usually a square matrix) in which the entries outside the main diagonal are all zero. The diagonal entries themselves may or may not be zero. Or, the values of the diagonal matrix.

Since a lot of things in programming is based on matrices doing thing horizontal or vertical is often easier then doing it diagonal. Questions dealing with these difficulties should be tagged diagonal.

Diagonal matrices occur in many areas of linear algebra. Because of the simple description of the matrix operation and eigenvalues/eigenvectors, it is always desirable to represent a given matrix or linear map by a diagonal matrix.

You probably want to add more specific tags about the technology you are using. Areas where the tag ´diagonal´ becomes relevant often drawing and animation.

584 questions
0
votes
1 answer

Numpy extract values on the diagonal from a matrix

My question is similar(the expanded version) to this post:Numpy extract row, column and value from a matrix. In that post, I extract elements which are bigger than zero from the input matrix, now I want to extract elements on the diagonal, too. So…
Heinz
  • 2,415
  • 6
  • 26
  • 34
0
votes
1 answer

To determine of box is a partof diagonal of matrix

I am trying to figure out how I can do this : Determine where the given box belongs which row, which column and which diagonal The matrix would be n x n always of any size. for eg : 0,0 | 1,0 | 2,0 0,1 | 1,1 | 2,1 0,2 | 1,2 | 2,2 Now this is the…
Chinmay
  • 338
  • 1
  • 5
  • 19
0
votes
0 answers

three.js cylinder wireframe without diagonals?

I am trying to draw a THREE.js wireframe cylinder without the diagonals in the faces. I am moving the vertices of the cylinder each frame as well, and am wondering if there is a solution to drawing it with quad faces without having to manually…
Nate_Hirsch
  • 671
  • 1
  • 6
  • 12
0
votes
1 answer

how to make a bullet shoot diagonally in flash as3

I have been having this problem for ages and haven't found a solution for this. Well in flash I have a character who's gun position is similar to…
0
votes
1 answer

Java Connect Four game not recognizing diagonal wins

I am trying to make a Connect Four game with 6 rows and 7 columns. The board is a String 2D array with each empty slot on the board being a ". " String. If I adjust the loops any more the program will give me an indexArrayOutOfBoundsException, so I…
user3552229
  • 11
  • 1
  • 3
0
votes
1 answer

python CSV edit elements in the diagonal of a matrix

I have a CSV file containing an n * n distance matrix, and here's a part of view, I want to use python to edit this CSV, making elements in the diagonal of the matrix replaced by 1, how should I do? I am using python 2.7.4 under Windows 8.1 x64.
Heinz
  • 2,415
  • 6
  • 26
  • 34
0
votes
2 answers

inverse of a large block diagonal sparse matrix in r

I would like to compute the inverse of some large block diagonal sparse matrix. The number of rows and columns is somewhat over 50,000. The blocks are 12 by 12 and are sparse (27 non zero elements). I tried to compute the inverse of the entire…
0
votes
1 answer

Ruby diagonal matrix from random numbers

I need to create a diagonal matrix (8x8) and fill it with random numbers in [-30..45] range After I need to transform array into vector and sort it I tried different ways. At first I create matrix (8x8) matrix = Matrix.build(8) {0} puts…
0
votes
1 answer

Using strfind in Matlab for different diagonal directions in a Matrix

Before anyone asks, this is a repost of an earlier question, but I cannot delete it because it has answers, so I am modifying it so that hopefully Daniel R will answer it! I have a grid of numbers and I want to read a string of numbers with strfind…
user3094936
  • 263
  • 6
  • 12
0
votes
1 answer

Getting lots of errors in Java, diagonal matrices questions

I have a Diagonal Matrix and I am trying to write a function for the sum of the matrix. Here is what I have so far: import java.io.*; public class DiagonalMatrices { public static void main(String[] args) throws IOException { double…
oliver18
  • 11
  • 2
0
votes
2 answers

MPI bordered block system/matrix with LU decomposition

i should resolve a bordered block system, here there are two version, the serial version that work properly and the parallel version (with MPI) that doesn't work and i don't know why... someone may help me to figure out…
realnot
  • 721
  • 1
  • 11
  • 31
0
votes
1 answer

Find largest intersecting diagonals

This is an interview question: Given a n by m matrix of bits find the largest X that is formed in the matrix and return the size of the diagonal of that X. An X is defined as 2 equally sized diagonals that share a single 1. For instance, the…
Darth.Vader
  • 5,079
  • 7
  • 50
  • 90
0
votes
2 answers

skewed separation in css

So I was trying to make a skewed separation in CSS (only). It should look kind of like this here: https://i.stack.imgur.com/hVCa1.png I tried it with CSS transforms already (transform: skew(-15deg);), but I don't think it'll work in all browsers,…
fabe
  • 15
  • 4
0
votes
1 answer

Why is spdiag deprecated in Octave, but not speye?

I've noticed that spdiag is deprecated, but not speye. Why is this? Both diag and eye generate diagonal matrices, so shouldn't speye be unnecessary as well (or at least exactly as unnecessary as spdiag)?
dspyz
  • 5,280
  • 2
  • 25
  • 63
0
votes
1 answer

d3js cluster layout dendogram node links to custom depths

I am trying to use d3js to develop a collapsing cluster dendogram with custom depths for the nodes. I can make the nodes appear where I'd like them to but the links drawn between the nodes using diagonal aren't going to the right spots. The links…
lucastimmons
  • 151
  • 1
  • 3
  • 11