I have a little problem. I've recently created an algorithm to allow thick lines to be drawed onscreen (as a quad structure), the problem is that when the line is very long and diagonal the aliasing is very high, making the line look very bad.
What are my chance to reduce the aliasing while trying to have high performance?
I'm using (as...
Just curious, I am reading a book on game AI. And one of the terms that is being used is to normalized a vector. Which is to turn a vector into units. To do so you must divide each dimension x,y and or z by its magnitude. We must we turn a vector into units before we do anything with it. Why ??. and could anyone give a scenario's . Thank...
I am trying to implement Pollard Rho integer factorization in C/C++.Google gives me a Java implementation of the problem here.
I don't know Java that well,so what I came up with this.My implemenation in C++ works for most cases but not in few like the one "9999", I used there.
I am aware that C++ didn't have Biginteger class so I can't...
I am working in a chemistry/biology project. We are building a web-application for fast matching of the user's experimental data with predicted data in a reference database. The reference database will contain up to a million entries. The data for one entry is a list (vector) of tuples containing a float value between 0.0 and 20.0 and an...
How come ceil() rounds up an even floating with no fractional parts?
When I try to do this:
double x = 2.22;
x *= 100; //which becomes 222.00...
printf("%lf", ceil(x)); //prints 223.00... (?)
But when I change the value of 2.22 to 2.21
x *= 100; //which becomes 221.00...
printf("%lf", ceil(x)); //prints 221.00... as expec...
Hi All,
I have two dimensional matrix. My matrix is sparse. I am facing performance problem. Can any body please answer that what api or class i can use in java to handle sparse matrix to improve my program performance.
For example I want
it take 100x100 matrix
handle sparse stuff
do the multiplication
return me my matrix same as 100x...
hi,
I have a number of 3x3 matricess that I want to multiply together For example:
m1*m2*m3*m4*m5
Although MTL is a recommended way, I don't have this library and can't use it.
Can someone please suggest a conventional way to multiply these 3x3 matrices (all matrices m1 to m5). Code snippet (for matrix multiplication and multiplyi...
Looking to provide a user with a list of different math calculations such a the area of a circle and Pythagoras theorem, What template should I use? The user will select a cell that will open to a calculation page, here they will be able to enter raw data to be calculated. If you know of a tutorial of sorts please direct. Thanks.
...
Hi again :)
I developed some java program to calculate cosine similarity on the basis of TF*IDF. It worked very well. But there is one problem.... :(
for example:
If I have following two matrix and I want to calculate cosine similarity it does not work as rows are not same in length
doc 1
1 2 3
4 5 6
doc 2
1 2 3 4 5 6
7 8 5 2 4 9
if...
Finding the point of intersection for two 2D line segment is easy; the formula is straight forward. But finding the point of intersection for two 3D line segment is not, I afraid.
What is the algorithm, in C# preferably that finds the point of intersection of two 3D line segments?
I found a C++ implementation here. But I don't trust th...
Some math calculations in JS problem solving
I am working on a zoom image functionality that creates a new div with a large image that is moved through x and y according to the mousemove on the image.
The large image should move a certain %, which is what i am trying to figure out. How much should it move by.
Here is some info:
T...
First off, let me say that this is not homework (I am an A-Level student, this is nothing close to what we problem solve (this is way harder)), but more of a problem I'm trying to suss out to improve my programming logic.
I thought of a scenario where there is an array of random integers, let's for example say 10 integers. The user will...
I'll apologize in advance in case this is obvious; I've been unable to find the right terms to put into Google.
What I want to do is to find a bounding volume (AABB is good enough) for an arbitrary parametric range over a trimmed NURBS surface. For instance, (u,v) between (0.1,0.2) and (0.4,0.6).
EDIT: If it helps, it would be fine f...
Hello,
I'm trying to use linsolve( ) from within a subroutine in order to code up a solution algorithm that is independent of the dimension of the problem.
The desire is to dynamically allocate the equation and variable arrays within the subroutine itself, pass these to linsolve( ) and hopefully get back the results.
/* SUBROUTINE IDE...
Is there an easy way to convert an angle (in degrees) to be between -179 and 180? I'm sure I could use mod (%) and some if statements, but it gets ugly:
//Make angle between 0 and 360
angle%=360;
//Make angle between -179 and 180
if (angle>180) angle-=360;
It just seems like there should be a simple math operation that will do both...
This is a counter. I'm making a spread sheet and getting nowhere. How do I measure these variables?
V A R I A B L E S
timer = speed
count = starting number and direction “+-“
fcount = time ramp “fast or slow”
MY THOUGHTS
- make an equation or spread sheet
- use a frame counter, but it's not frame based
CODE
Define an instance of...
I'm in a need to optimize this really tiny, but pesky function.
unsigned umod(int a, unsigned b)
{
while(a < 0)
a += b;
return a % b;
}
Before you cry out "You don't need to optimize it", please keep in mind that this function is called 50% of the entire program lifetime, as it's being called 21495808 times for the sm...
Picture a circle. Now divide the circle vertically and horizontally into four regions. Take the top left region. If you drew a box around it, you'd have a box with a rounded corner heading east.
Given an X and Y coordinate in that box of that single top left region, how can I tell whether a point is to the left of the circle's line, or ...
I need Math.radians() function and can not find it. Thx for help.
radians=(angle/180)* Math::PI
...
I wonder if there is a framework or something else to display Math formula on a web page. Other than using images of those formulas...
...