Below is a cubic interpolation function:
public float Smooth(float start, float end, float amount)
{
// Clamp to 0-1;
amount = (amount > 1f) ? 1f : amount;
amount = (amount < 0f) ? 0f : amount;
// Cubicly adjust the amount value.
amount = (amount * amount) * (3f - (2f * amount));
return (start + ((end - start) ...
hello, i am looking for a sample code implementation on how to invert a 4x4 matrix. i know there is gaussian eleminiation, LU decomposition, etc. but instead of looking at them in detail i am really just looking for the code to do this.
language ideally C++, data is available in array of 16 floats in cloumn-major order.
thank you!
...
The kernel trick maps a non-linear problem into a linear problem.
My questions are:
1. What is the main difference between a linear and a non-linear problem? What is the intuition behind the difference of these two classes of problem? And How does kernel trick helps use the linear classifiers on a non-linear problem?
2. Why is the dot ...
In Python, there are examples of built-in classes with highly constrained instances. For example, "None" is the only instance of its class, and in the bool class there are only two objects, "True" and "False" (I hope I am more-or-less correct so far).
Another good example are integers: if a and b are instances of the int type the...
I have values returned by unknown function like for example
# this is an easy case - parabolic function
# but in my case function is realy unknown as it is connected to process execution time
[0, 1, 4, 9]
is there a way to predict next value?
...
Hello,
I am currently using scipy's linregress function for single regression. I am unable to find if the same library, or another, is able to do multiple regression, that is, one dependent variable and more than one independent variable. I'd like to avoid R if possible. If you're wondering, I am doing FX market analysis with the goal ...
I am using UIAcceleration for rotation. I have opposite side, adjacent side, but I want to calculate tan-1(y/x) inverse tan.
...
I'm currently reading from a depth texture in a postprocess depth of field shader using the following GLSL code:
vec4 depthSample = texture2D(sDepthTexture, tcScreen);
float depth = depthSample.x * 255.0 / 256.0 +
depthSample.y * 255.0 / 65536.0 +
depthSample.z * 255.0 / 16777216.0;
And then converting the ...
Is there a standard and/or portable way to represent the smallest negative value (e.g. to use negative infinity) in a C(++) program?
DBL_MIN in float.h is the smallest positive number.
...
I need to implement an inverted beta function in MySQL (similar to Excel's BETAINV).
There is some related material is available on Wolfram MathWorld's Beta Distribution page.
Any clues on where to start implementing this functionality in MySQL?
...
I have been asked to program a routine to decide the number of possible combinations in a product configurator.
The configurator is really simple. Even though it has more features than this, it can be modeled as several "radio groups" (like the UI control) where one of n options has to be selected.
The only kind of constraints that can...
I am looking to create a custom math library for the project I am working on. The project is written in C#, and I am slightly concerned whether C# will be fast enough. The library will have a number of custom math formulas and equasions to be applied to very large data sets. Simulations and matrix operations will be done as well (i.e. Mo...
I'm looking for a standalone math equation renderer that generates a gif or png file. It should be able to take equation input from a URL. It has to work on a webserver, preferably on IIS and .NET based.
I read the previous topics here, but none of them seem to work well.
...
Possible Duplicate:
How do you calculate the average of a set of angles?
I have two angles, a=20 degrees and b=350 degrees. The average of those two angles are 185 degrees. However, if we consider that the maximum angle is 360 degrees and allows for wrap around, one could see that 5 degrees is a closer average.
I'm having trou...
Consider a vector V riddled with noisy elements. What would be the fastest (or any) way to find a reasonable maximum element?
For e.g.,
V = [1 2 3 4 100 1000]
rmax = 4;
I was thinking of sorting the elements and finding the second differential {i.e. diff(diff(unique(V)))}.
EDIT: Sorry about the delay.
I can't post any representati...
I need to do calculations (division or multiplication) with very large numbers. Currently I am using Double and getting the value round off problems. I can do the same calculations accurately on C# using Decimal type. I am looking for a method to do accurate calculations in VB6.0 and I couldn't find a Decimal type in VB6.0.
What is the...
I am using OdePkg in Octave to solve a system of stiff ODEs, e.g. by ode5r:
function yprime = myODEs(t,Y,param)
yprime = [
- param(1) * Y(1); # ODE for Y(1)
param(1) * Y(1) - param(2) Y(2) * Y(3); # ODE for Y(2)
param(2) Y(2) * Y(3) # ODE for Y(3)
...
Let's say I have a slider that can go between 0 and 1. The SoundTransform.volume also ranges between 0 (silent) and 1 (full volume), but if I use a linear function, let's say SoundTransform.volume = slider.volume, the result is rather not pleasing.
I really haven't studied the human ear, but I overheard once that human perception is log...
I have x,y data coming in from a [coordinates1] database (GIS - but this could be any database). I have my application with it's own coordinate system, referencing THE SAME MAP.
I have established that a linear relationship exists between coordinates1(x,y) and coordinates2(x,y) as I have subtracted two different coordinates1 and coordin...
Having a list of points, how do I find if they are in clockwise order?
For example:
point[0] = (5,0)
point[1] = (6,4)
point[2] = (4,5)
point[3] = (1,5)
point[4] = (1,0)
would say that it is anti-clockwise (counter-clockwise for some people).
...