Hi All,
I am using jama to calculate SVD. It work very good. If i pass square matrix. For example 2x2 or 3x3 etc. matrix. But when I pass some thing like this 2x3 or 4x8 it give
error . I used all of their example. They have different constructor to perform the job. Also my second question is, I am usded 3x3 matrix and it gave
double[...
I have the following function that I am so close to cracking but can't find a mod function in obj-c. I hope someone can help suss this.
-(void)estimatePosition{
float lat1 = 50.000;
float lon1 = -1.666;
float d = 500;
float tc = 90;
float lat;
float dlon;
float lon;
lat =asin(sin(lat1)*cos(d)+cos(lat1)...
I'm trying to find an algorithm that will compute the intersection between 2 rectangles, which are not necessarily axis-aligned, and return the resulting intersection.
This question describes finding whether an intersection exists. I'd like to have the resulting shape of the intersection, if it exists.
My application of the algorithm w...
I've found functions which follow the pattern of 1 / bc produce nice curves which can be coupled with interpolation functions really nicely.
The way I use the function is by treating 'c' as the changing value, i.e. the interpolation value between 0 and 1, while varying b for 'sharpness'. I use it to work out an interpolation value betwe...
I have a renderer using directx and openGL, and a 3d scene. The viewport and the window are of the same dimensions.
How do I implement picking given mouse coordinates x and y in a platform independent way?
...
Using C#:
How do I get the (x, y) coordinates on the edge of a circle for any given degree, if I have the center coordinates and the radius?
There is probably SIN, TAN, COSIN and other grade ten math involved... :)
...
I'm creating a word search and am trying to calculate quality of the generated puzzles by verifying the word set is "distributed evenly" throughout the grid. For example placing each word consecutively, filling them up row-wise is not particularly interesting because there will be clusters and the user will quickly notice a pattern.
...
I need to implement a Geo proximity search in my application but I'm very confused regarding the correct formula to use. After some searches in the Web and in StackOverflow I found that the solutions are:
Use the Haversine Formula
Use the Great-Circle Distance Formula
Use a Spatial Search Engine in the Database
Option #3 is really no...
I am pulling a set of numbers from a MySQL database and am trying to do some simple math on them to calculate a total price to put into an invoice, but PHP isn't cooperating. I thought it might be a type-coercion issue, so I tried adding some intval and floatval calls, but still the total always comes out to 0.
Here is the relevant cod...
So I have a 3D Plane described by 2 Vectors:
P : a point which lies on the Plane
N : the surface normal for the Plane
And i have a very large, flat square Polygon, which I want to render to represent this Plane. I can easily translate the polygon to the given point, but then I need to find the proper rotation to apply to make the...
I have some code to count permutations and combinations, and I'm trying to make it work better for large numbers.
I've found a better algorithm for permutations that avoids large intermediate results, but I still think I can do better for combinations.
So far, I've put in a special case to reflect the symmetry of nCr, but I'd still lik...
So there is a method for NaN, but divide by zero creates infinity or negative infinity.
There is a method for Infinity (also positive infinite and negative infinity).
What I want is IsARealNumber function that returns true when the value is an expressible number.
Obviously I can write my own...
public bool IsARealNumber(double test)
...
I am looking to calculate the X and Y points of each point on a polygon, given the number of sides, and the fact that all sides are equal. I would also have the width and height constraints of the entire shape. If it helps any, I would be doing this in Java (most likely using Line2D).
...
Im having a trouble with the flex calculation, im trying to transform a pixel value to mm and reversing it.
Starting out with 69.8:
Calculating MM to pixel from: 69.8 mm
69.8*300 = 20940
20940 / 2.54 = 8244.094488188975
8244.094488188975 / 10 = 824.4094488188975
And calculating back:
Calculating pixel to MM from: 824.4094488188975
8...
Hi folks,
I have a 256x256 texture in my view frustum that I need to move to a z-position where the texture is replicated on-screen at ACTUAL size.
What I have so far is:
const float zForTrueScale = -((itemSize/2) / tanf(DEGREES_TO_RADIANS(fieldOfView/2)) ) * 2;
where itemSize is the size of my texture in world space (2.0 u...
EDIT: Wow, many great responses. Yes, I am using this as a fitness function for judging the quality of a sort performed by a genetic algorithm. So cost-of-evaluation is important (i.e., it has to be fast, preferably O(n).)
As part of an AI application I am toying with, I'd like to be able to rate a candidate array of integers base...
Hi all,
I'm working on a code to do a software skinner (bone/skin animation), and I'm at the "optimization" phase (the skinner works pretty well and skin a 4900 triangles mesh with 22 bones in 1.09 ms on a Core Duo 2 Ghz (notebook)). What I need to know is :
1) Can someone show me the way (maybe with pseudocode) to transform a float3 (a...
Apple has (apparently) changed how they calculate KB, MB, and GB in 10.6. Instead of using 1024, they use 1000. (As described here: http://reviews.cnet.com/8301-13727_7-10330509-263.html)
My question is how do deal with this in my code? I'm trying to get the amount of space free, so I get the number of bytes via NSFileManager. When I go...
I am using Latent semantic analysis for text similarity. I have 2 questions.
How to select K value for dimention reduction?
I read alot every where that LSI work for similary meaning words for example car and automobile. How is it possible??? What is the magic step I am missing here?
...
x+2y=8 , 2x+y=14 this are equations this is just example i gave for understanding . from this equation i like to find x,y values using c# program anybody help for me.how can implement this in program?...
...