See also: Why is my image rotation algorithm not working?
This question isn't language specific, and is a math problem. I will however use some C++ code to explain what I need as I'm not too hot on math.
Here's how the image is composed:
ImageMatrix image;
image[0][0][0] = 1;
image[0][1][0] = 2;
image[0][2][0] = 1;
image[1][0][0] ...
If I have a series of pixels, which range from say -500 to +1000, how would I normalize all the pixels on the same gradient so that they fall between a specific range, say 0 and 255?
...
I'm doing some image processing, and I need to find some information on line growing algorithms - not sure if I'm using the right terminology here, so please call me out on this is needs be.
Imagine my input image is simply a circle on a black background. I'd basically like extract the coordinates, so that I may draw this circle elsewhe...
Attempts 1 & 2:
Note: Removed first attempts to cut down on question size. See community wiki for previous attempts.
Attempt 3:
As per fuzzy-waffle's example, I have implemented the following, which doesn't appear to work correctly. Any ideas what I could be doing wrong?
ImageMatrix ImageMatrix::GetRotatedCopy(VDouble angle)
{
//...
Imagine I have this list, that is divided by 3
1
2
3
4
5
6
7
8
9
Now, I have 9 items, grouped in 3 sections.
My question is how know in which section is 6 (ie: 6 belong to section 2, 2 to section 1, 9 to section 3)
...
I'm a math professor that is losing his job, and I'm trying to gain programming skills, since academic jobs are scarce these days.
Are there particular types of programming jobs that I should try to work towards, in order to leverage my math Ph.D? What particular skills should I try to obtain for those jobs?
Update, 6 months later: F...
Just realized that I am getting errors on simple math if I mixed Integer with floats in iPhone SDK on the Simulator. Two examples:
float testVal1 = 10 + 5/10;
//evaluates to 10 instead of 10.5 unless I use explicit 10.0f..
// Problem Code mixed float int
NSUInteger jvalue = 2312345;
NSInteger testVal2 = (jvalue - 2512345); // evalua...
Hi friends,
I have an ASP page where I have 2 variables, strActualRate and strProposed.
The values are:
strActualRate = 33.30
strProposed = 33.3
So when I write the following line to compare:
if strActualRate <> strProposed then
Response.Writr "Both are not equal!"
end if
I am getting the output "Both are not equal", even though...
Looking further into the differences between Python and Ruby, is there a Ruby equivalent to SciPy, or what other scientific math gems are available for Ruby?
...
I just finished implementing a kd-tree for doing fast nearest neighbor searches. I'm interested in playing around with different distance metrics other than the Euclidean distance. My understanding of the kd-tree is that the speedy kd-tree search is not guaranteed to give exact searches if the metric is non-Euclidean, which means that I ...
I'm moving through the atmosphere with Microsoft Virtual Earth 3D and I can descend smoothly, but I don't know the math to ascend smoothly.
I'm descending like this:
for(int curAlt = startAlt; curAlt < endAlt; curAlt--){
//do something
curAlt -= curAlt/150
}
This works by decreasing the size of the jump the closer I get to th...
/**
* Returns a number between kLowerBound and kUpperBound
* e.g.: Wrap(-1, 0, 4); // Returns 4
* e.g.: Wrap(5, 0, 4); // Returns 0
*/
int Wrap(int const kX, int const kLowerBound, int const kUpperBound)
{
// Suggest an implementation?
}
...
I have a Point on the surface of the earth which I am converting to a Vector from Earth Center.
I have a True North Heading in degrees describing the path the point will travel on the surface of the earth.
I need to calculate a Vector which is perpendicular to the plane created by the path of this point along the earths surface.
I hav...
We've gotten a homework assignment in Java, which relates to inheritance. I don't have a problem with the programming in itself, but I'm a bit unsure about some of the math, and would like confirmation/corrections from someone a bit more knowledgable.
The assignment starts with a abstract class, GeometricObject, which is extended into t...
Given a series of incoming items, I want to assign each one to a bucket as it comes in. The bucket can either be a new one (one that has never been used before, of which there are an infinite supply) or it can be an existing bucket. If I look at the number of buckets with one item, the number with two, the number with three, etc., I want...
I have a bunch of floating point numbers (Java doubles), most of which are very close to 1, and I need to multiply them together as part of a larger calculation. I need to do this a lot.
The problem is that while Java doubles have no problem with a number like:
0.0000000000000000000000000000000001 (1.0E-34)
they can't represent some...
I'm looking for a component that generates math equations.
like what wikipedia has but for windows server.
if i enter x^2, it will generate a gif with proper formatting as output
It must run on IIS and .NET and not a web service from somewhere.
has anyone seen anything that does this?
...
I am looking for square root functions (to use in java) that can give square roots upto atleast to 5-6 decimal places accurately. If there is a way to control accuracy of java.lang.Math.sqrt(double) or any external math library, please mention it.
...
Do you have any recommendations of books or websites that would teach me mathematical notation. As a developer I work on a wide range of projects from .NET/SQL Server stuff through to Flash games and I often find myself referring to articles on the internet for guidance. Many of the articles contain mathematical formula, and unless they ...
Here is the problem:
One sheet contains 10 labels. I want to print many labels, but from an arbitrary starting index. Now, I want to find how many sheets would be required to print the labels that the user desires. For example, let's say I took starting index 52 and I want to print 23 labels. Then how do I find the number of sheets ...