Nibcode Solutions Blog

Learn about math applications and other interesting topics

results for category: Javascript
Linear algebra and digital image processing. Part IV. Image editor.

Linear algebra and digital image processing. Part IV. Image editor.

Anibal Rodriguez
Anibal Rodriguez
October 27, 2016

In this post, the last one of the series, we'll show an implementation in JavaScript of all the theory we have seen in the previous three posts. We also explain how you can use the HMTL5 canvas object to make your own implementation of the concepts of image processing.

The JavaScript image editor presented in the post, allows you to apply filters and make transformations to any image you choose. Besides, when moving the mouse cursor over the image, you can see, under the image, the 5x5 matrix of pixels surrounding the pixel at the cursor position.

Using matrix operations to solve the Einstein

Using matrix operations to solve the Einstein's riddle. Part II.

Anibal Rodriguez
Anibal Rodriguez
November 16, 2015

In the previous part of this article we formulated the Einstein's riddle in terms of matrices, and presented three matrix operations that will be the base for an algorithm to solve the riddle. In this part we'll be talking about this algorithm, and a JavaScript implementation which will allow solving this riddle and any other grid riddle similar to this one.

There are some programming languages as Prolog, designed to work with logic facts, where you can deal with logical problems in a natural way. By using the matrix formulation we can use any programming language to deal with this kind of riddles. Here we provide the implementation, in JavaScript, of the matrix object with the three basic operators used to solve the riddles. The selection of JavaScript is not arbitrary, it allows to show the effectiveness of the algorithm in this same post.

Cryptography and linear algebra

Cryptography and linear algebra

Anibal Rodriguez
Anibal Rodriguez
June 25, 2014

Since humans invented the written language, they have tried to share information secretly. This is basically, the objective of Cryptography, the study of the techniques to protect sensitive communications by means of data encryption and its posterior decryption. Encryption is the transformation of data into some unreadable form, so, even those who can see the encrypted data cannot understand the hidden information. Decryption is the reverse of encryption; it is the transformation of encrypted data back into some intelligible form.

Although there are different methods to encrypt and decrypt messages, we'll focus on a linear algebra based cipher, the Hill cipher, which uses a matrix as a cipher to encode a message, and it's extremely difficult to break when a large matrix is used. The receiver of the message decodes it using the inverse of the matrix.