math

How can I get latitude, longitude from x, y on a Mercator map (JPEG)?

I have a Mercator projection map as a JPEG and I would like to know how to relate a given x, y coordinate to its latitude and longitude. I've looked at the Gudermannian function but I honestly don't understand how to take that function and apply it. Namely, what input is it expecting? The implementation I found (JavaScript) seems to t...

GPS coordinates in degrees to calculate distances

On the iPhone, I get the user's location in decimal degrees, for example: latitude 39.470920 and longitude = -0.373192; That's point A. I need to create a line with another GPS coordinate, also in decimal degrees, point B. Then, calculate the distance (perpendicular) between the line from A to B and another point C. The problem is I ge...

Linear regression confidence intervals in SQL

I'm using some fairly straight-forward SQL code to calculate the coefficients of regression (intercept and slope) of some (x,y) data points, using least-squares. This gives me a nice best-fit line through the data. However we would like to be able to see the 95% and 5% confidence intervals for the line of best-fit (the curves below). ...

Finding quaternion representing the rotation from one vector to another

I have two vectors u and v. Is there a way of finding a quaternion representing the rotation from u to v? ...

Predicting missing data values in a database

I have a database, consisting of a whole bunch of records (around 600,000) where some of the records have certain fields missing. My goal is to find a way to predict what the missing data values should be (so I can fill them in) based on the existing data. One option I am looking at is clustering - i.e. representing the records that ar...

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 = ...

Similarity Between Colors

I'm writing a program that works with images and at some point I need to posterize the image. This means I need to bin the colors, but I'm having trouble deciding how to tell how close one color is to another. Given a color in RGB, I can think of at least 2 ways to see how different they are: |r1 - r2| + |g1 - g2| + |b1 - b2| sqrt((r1...

Where can I find math topics and resources for programmers?

There are a few questions around that circle around this question but I feel this is different enough. I've decided I want to improve the breadth and depth of my maths skills specifically in areas that are useful and/or interesting to programmers. What topics should I study? What resources do you recommend (blogs/books/online lectures...

Signed Angle in 3D Vectors

This is a purely math question, I believe. I have a camera object in an arbitrary coordinate system. I have the direction vector of the camera, and I have a vector that points in the direction of north along the surface of the sphere. I wish to calculate the angle of the camera in regards to the north vector. Is there a simple way to c...

What do [0, rows) and [1, rows] mean? more specifically [ and )

I understand that it's from 0 to rows and from 1 to rows, but which is including and which is excluding? ...

Is there a strongly typed programming language which allows you to define new operators?

Hello, I am currently looking for a programming language to write a math class in. I know that there are lots and lots of them everywhere around, but since I'm going to start studying math next semester, I thought this might be a good way to get a deeper insight in to what I've learned. Thanks for your replys. BTW: If you are wonderin...

Are integers in C assumed to be handled by a hardware spec or handled in software?

Are integers in C assumed to be handled by a hardware spec or handled in software? By integer, I am referring to the primitive "int" The underlying idea being that if integers in C are not hardware dependent would it be a violation of standard to have gcc implement different integer handlers. This way you could have your traditional 32...

Intel Math Kernel on windows, calling from c# for random number generation

Has anyone used the Intel Math Kernel library http://software.intel.com/en-us/intel-mkl/ I am thinking of using this for Random Number generation from a C# application as we need extreme performance (1.6 trillion random numbers per day). Also any advice on minimising the overhead of consuming functions from this c++ code in my c# Monte...

Isometric projection in 2d coordinate system

What equation is needed to move a point on an isometric plane in a 2d space? I've looked several places on the tubes. Mostly here. and I haven't been able to decipher it. I'm not a math major, unfortunately. What I need to do is move a point from (0,0) to (1,0) or (0,1) on an isometric plane consisting of 10px blocks. In normal-ville ...

Mathematical notation in algorithms

I am currently reading the Algorithm Design Manual, but my mathematical notation has become a little rusty. What does mean? ...

Good algorithm for finding the diameter of a (sparse) graph?

I have a large, connected, sparse graph in adjacency-list form. I would like to find two vertices that are as far apart as possible, that is, the diameter of the graph and two vertices achieving it. I am interested in this problem in both the undirected and directed cases, for different applications. In the directed case, I of course ...

Given a total, determine how many times a value will go into it

The Problem: A box can hold 53 items. If a person has 56 items, it will require 2 boxes to hold them. Box 1 will hold 53 items and box 2 will hold 3. How do i repeat the above where 53 is a constant, unchanging value and 56 is a variable for each box: Math.Ceiling(Convert.ToDecimal(intFeet / 53)) what i have so far that is: int Tota...

Required math for Computational Finance?

I don't have a strong mathematical background, but I would love to work on some computational finance problems. I got "An Introduction to Computational Finance Without Agonizing Pain " by Peter Forsyth, but it still was pretty hard for me to follow what he was saying. What are the required maths prerequisites for this course? I want to...

How to find overlapped items?

Dear all, Is it possible to find out whether one drawing line (which is not in a horizontal or vertical position) overlapped (or touched) any other items (like line, rectangle, circle etc). Kindly advise me on the possibilities and solution with examples. Thanks for looking into this... ...

When do you decide to represent something as a vector?

In information retrieval, the words in the documents were represented as a "Term Vector", they did it primarily to check the angle between two vectors. When have you represented something as a vector in your work and what is the common heuristic that you use to represent an entity as a vector? ...