I was first introduced to the idea of Matrices and determinants in my high school linear algebra class. Back then my only goal was to remember how to compute them using the given formulas. When I visited the determinants again after many years for one of my computer vision projects, It became clear I had […]

# Category: Mathematics

### Computing the discrete Fréchet distance using dynamic programming

Definition The Fréchet distance is usually explained using the analogy of a man walking his dog. A man is walking a dog on a leash: the man can move on one curve, the dog on the other; both may vary their speed, but backtracking is not allowed. What is the length of the shortest leash […]

### Otsu’s method for image thresholding explained and implemented

The process of separating the foreground pixels from the background is called thresholding. There are many ways of achieving optimal thresholding and one of the ways is called the Otsu’s method, proposed by Nobuyuki Otsu. Otsu’s method[1] is a variance-based technique to find the threshold value where the weighted variance between the foreground and background […]

### Fast nth Fibonacci number algorithm

Definition: The Fibonacci sequence is defined by the equation, where \(F(0) = 0 \), \(F(1) = 1 \) and \(F(n) = F(n-1) + F(n-2) \text{for } n \geq 2 \). This gives us the sequence 0,1,1,2,3,5,8,13 … called the Fibonacci Sequence. This post is about how fast we can find the nth number in the […]

### Understanding Graham scan algorithm for finding the Convex hull of a set of Points

Convex Hull is one of the fundamental algorithms in Computational geometry used in many computer vision applications like Collision avoidance in Self Driving Cars, Shape analysis and Hand Gesture-recognition, etc. By Definition, A Convex Hull is the smallest convex set that encloses a given set of points. For Example, Given a set of points P […]

### Find clusters of collinear points from a given set of data points

A set of 3 or more points are said to be collinear if they all lie on a straight line as shown in the image below. One common way of checking if three points are collinear is by finding the area of the triangle formed by the points. The area will be zero if the […]

### Deriving the famous Euler’s formula through Taylor Series

Euler’s formula is often coined the most remarkable formula in mathematics. It combines the seemingly unrelated exponential functions, imaginary numbers, and trigonometric functions into a single aesthetically pleasing and beautiful equation. We see five numbers (e, i, π, 0, and 1) that we are familiar with as well as three simple operations (exponentiation, multiplication, and […]

### Function to get the preceding odd number (y) for any given number (x)

For any function, We want, for every value of x, return the corresponding odd number. If x is odd then return it as it is, else return the next number. This can easily be done using a computer program by checking if the number is odd or even. But if you had to find a […]

### Using the law of cosines and vector dot product formula to find the angle between three points

For any 3 points A, B, and C on a cartesian plane. If we have to find the angle between these points, there are many ways we can do that. In this article I will talk about the two frequently used methods: The Law of Cosines formula Vector Dot product formula Law of Cosines For […]

### Why isn’t n/0 allowed in mathematics.

If you divide 4 by 2 you would get 2 as the quotient, which means there are exactly two 2’s in 4. And similarly, If you divide 5 by 2, you would get 2 as the quotient and 1as the remainder, which means there are two 2’s in 5 and a 1 which if you […]