All Questions
Tagged with matrix javascript
21 questions
3
votes
1
answer
85
views
OpenProcessing.org JavaScript program - Building a list of matrices
My openprocessing.org JavaScript code listed below produces the output I want but doesn’t seem very elegant to me especially the “.M” in “matrices[mat].M[row][col]”. Any comments to improve the ...
3
votes
0
answers
97
views
Speed up a JavaScript function for inverting matrices using Gauss elimination
I wrote this function and I'm interested if it can be sped up by improving the code.
The function accepts either column major 1D array or 2D row major array.
Maybe there are some obvious JS tricks ...
3
votes
0
answers
36
views
How would you convert this code to best take advantage of CSS transform for panning/zooming?
I am using react-flow-chart for a job project, but it doesn't implement zoom, and I would like to take the reigns and try applying it myself. I took a linear ...
1
vote
2
answers
461
views
JavaScript Spiral Matrix Coding Challenge
A whiteboarding challenge: Given a 2D array (matrix) inputMatrix of integers, create a function spiralCopy that copies ...
0
votes
1
answer
122
views
Combine Matrix Columns JavaScript
I did this Codepen to combine all the columns from one matrix in JS.
...
2
votes
0
answers
131
views
Dijkstra in JavaScript
I am writing the solution of Dijkstra's algorithm in JS. This is what has happened so far. I need to make it so that the choice of nodes is by recursion. Tell me how to do this better.
...
6
votes
3
answers
14k
views
Rotate an N × N matrix 90 degrees clockwise
Given the problem from "Cracking the coding interview"
Given an image represented by an NxN matrix, where each pixel in the
image is 4 bytes, write a method to rotate the image by 90 degrees ...
0
votes
2
answers
2k
views
Simple Matrix Rotation
I needed to rotate a non-square matrix in my program to transpose some spreadsheet data and decided to make a function to rotate 90, 180, or 270 degrees.
It doesn't rotate the matrix in place, but ...
3
votes
1
answer
535
views
Find largest connected cells of value 1 or greater
My goal is to find the largest connected "cell" of 1's in a matrix.
My approach has been to search the surrounding area of a cell that is not on a border and then if it hasn't been visited, and has a ...
1
vote
2
answers
2k
views
Multiplying 4*4 matrices
I'm multiplying 4x4 matrices for learning purposes. How can I optimize this for performance?
HTML
...
7
votes
3
answers
15k
views
JavaScript solution for diagonal difference
hackerrank.com - diagonal difference:
Problem Statement
You are given a square matrix of size N×N. Calculate the absolute
difference of the sums across the two main diagonals.
Input ...
2
votes
1
answer
91
views
Net health monitoring
This is a little net health monitoring project I made in NodeJS. It pings Google every second and stores the result (true/false) along with the date in a database (MongoDB). I've collected enough data ...
4
votes
2
answers
1k
views
D3 Matrix table
I am able to develop this matrix but I think code can be improved. I am creating a map on which each rectangle may have zero through many list items with their titles (still need to add code for ...
6
votes
1
answer
824
views
Linear algebra, reduced row echelon form - function 1
This is a derivative post from here.
This is just a general review, so the question is the same:
Is there something...
That you would consider as a bad practice and why?
That is just bad in some ...
5
votes
1
answer
2k
views
Linear algebra, reduced row echelon form
The code that I am sharing here for you to review today, is a segment of a JavaScript library that I am going to write as time goes by for fun. It is only the two functions in the following code:
<...