Given 2 java AffineTransform items, how can I interpolate between them. I need the image on screen to slowly move from the position/rotation/scale with one matrix applied, to the other.
Preferably this should be reasonably efficient since it's running every time a game draws.
My current (really hacky) solution is to getTranslate() from...
(pseudo code)
function highest(i, j, k)
{
if(i > j && i > k)
{
return i;
}
else if (j > k)
{
return j;
}
else
{
return k;
}
}
I think that works, but is that the most efficient way?
...
Assume you know a student who wants to study Machine Learning and Natural Language Processing.
What introductory subjects would you recommend?
Example: I'm guessing that knowing Prolog and Matlab might help him. He also might want to study Discrete Structures*, Calculus, and Statistics.
*Graphs and trees. Functions: properties, recur...
this is little hard one. i have latitude and longitude and i want to pull the record from the database, which has nearest latitude and longitude by the distance, if that distance gets longer then specified one, then don't retrieve it.
Table structure:
id
latitude
longitude
place name
city
country
state
zip
sealevel
...
Am trying to solve the given recursion, using recursion tree, T(n) = 3T(n/3) + n/lg n.
In the first level (n/3)/(log(n/3)) + (n/3)/(log(n/3)) + (n/3)/(log(n/3)) = n/(log(n/3)).
In the second level it turns out to be n/(log(n/9)).
Can I generalize the above equation in the form of n.loglogn
This is a general doubt I've, I need an in...
As the title, I'm finding vector/matrix library in C optimized for iPhone/iPod processors.
Or just generally fast.
---(edit)---
I'm sorry for unclear question.
I'm looking for fast lib for commercial games for iPhone/iPod. So GPL lib cannot be used.
However, I'll stop finding fastest lib, it maybe meaningless.
...
I recently found a contest problem that asks you to compute the minimum number of characters that must be inserted (anywhere) in a string to turn it into a palindrome.
For example, given the string: "abcbd" we can turn it into a palindrome by inserting just two characters: one after "a" and another after "d": "adbcbda".
This seems to b...
Hi
I want to increase a decimal's smallest fractional part with one so that for example
decimal d = 0.01
d++
d == 0.02
or
decimal d = 0.000012349
d++
d == 0.000012350
How do i do this?
...
Hello everybody.
I have to write, for academic purposes, an application that plots user-input expressions like: f(x) = 1 - exp(3^(5*ln(cosx)) + x)
The approach I've chosen to write the parser is to convert the expression in RPN with the Shunting-Yard algorithm, treating primitive functions like "cos" as unary operators. This means the f...
i've got a problem with the sampling theorem
Sampling theorem states that a signal can be reconstructed exactly from it's samples if the original signal has no frequencies above half the sampling frequency.
But what about frequencies exactly half the sampling frequency?? let's say i sample a sine (with an arbitrary phase and amplitude)...
I ask because a lot of game programming and graphic design seems to use the z-axis a lot. I didn't know what kind of math uses it so I could understand it and its relation to programming graphics applications. I don't remember seeing it - all the way up to calc 2.
...
What are the no of combinations in which 8 persons taking part in a knockout tornament play? Total no of matches played would be 7 but I also need the number of combinations that can for this set
...
I would like to map a thread_id. This in C/CUDA but it is more an algebraic problem that I am trying to solve.
So the mapping I am trying to achieve is along the lines:
Threads 0-15: read value array[0]
Threads 16-31: read value [3]
Threads 32-47: read value [0]
Threads 48-63: read value [3]
Threads 64-79: read value array[6]
Thread...
I've been using isinf,isnan functions on linux platforms which worked perfectly.
But this didn't work on osx, so I decided to use std::isinf std::isnan which works on both linux and osx.
But the intel compiler doesn't recognize it, and I guess its a bug in the intel compiler according to http://software.intel.com/en-us/forums/showthread...
I'm creating an application in C# 3.5 that uses the AutoCAD API to read a 2D AutoCAD drawing, make changes to the drawing using defined business logic, then adjust it back in AutoCAD. Due to the nature of the logic, the shape of the drawing has to be re-constructed - e.g. a rectangle is made up of 4 connecting straight lines.
I'm creat...
Some math functions in a program I recently wrote are returning unacceptable values, such as NaN (possibly due to not checking some function's input params). The problem is that it's being quite difficult to track down which functions are passing the wrong values. This results in errors being propagated throughout the code and making the...
I have a unit in a game which is pointing in a particular direction; when it turns to another direction it should take the shortest turn available. The scheme starts at a particular angle, and requires a given angle to lerp (linear interpolate) towards.
For example, lerping from 10 degrees to 350 degrees should calculate a target angle ...
I have a system of 22 linear equations (exactly 22 equations and 22 unknowns) which are dynamically generated in an Excel spreadsheet. Is there a way to have Excel solve the system and produce a value for each of the unknown variables?
Another SO question has a lot of good information about the algorithms used to solve such equations. C...
Hi!
This fall I'm going to the uni. Warsaw University, which is my 1st choice (for now at least) offers a joint course in Math and CS (resulting in two diplomas). Is this a good combination? The course is quite famous for the difficulty and work involved (there's quite the dropout rate AFAIK).
It's worth mentioning that I see my futur...
Does anyone know how to minimize a function containing an integral in MATLAB? The function looks like this:
L = Int(t=0,t=T)[(AR-x)dt], A is a system parameter and R and x are related through:
dR/dt = axRY - bR, where a and b are constants.
dY/dt = -xRY
I read somewhere that I can use fminbnd and quad in combination but I am not a...