math

Function approximation

I have a function, P(x0, x1, ..., xn) that takes 100 integers as input and gives as output an integer. P is a slow function to evaluate(it can range from 30 seconds to a couple of minutes). I need to know which values of points will maximize the yielded value from P. What techniques can I use to accomplish this? I know generally peop...

Calculate Rows per Column for CSS in VB.NET?

I am trying to figure out a calculation I can perform in C# to determine the rows per column. Let's say I know I am going to have 3 columns and my record count is 46. I know that I can mod the results to get a remainder, but I would like something more efficient than what I have tried. So I know I will have 16 rows per column with a rem...

An error with... operator precedence?? (.Net Compact Framework)

Hello! I have this operation: t = (x - (y * (z + w)) - w) / 2; where: x = 268; y = 4; z = 20; w = 30; As far as I know the result will be 49, but I getting 19. Where is my error? (In using this code on a .Net Compact Framework 2.0 SP2 WinForm app). Thank you. ...

Ballistics Library

Does anyone know if there has been a port of the GNU Ballistics library to C#, java, vb, etc? Is there a similar library out there in any other language, even C++? ...

Solving second degree simultaneous equation

What would be the solution to the following two equations ? A1uv + B1u + C1v + D1 = 0 A2uv + B2u + C2v + D2 = 0 u, v in [0, 1] The solution needs to be blazing fast because it needs to be solved for each pixel, hopefully a direct rather than iterative solution. This is basically trying to find the inverse of a coons patch where the ...

C# Math Function Implementation Help

How can I implement the following function: in C#? Thanks. ...

Mixing two RGB color vectors to get resultant

I am trying to mix two source RGB vectors to create a third "resultant vector" that is an intuitive mix of the first two. Ideally, I would be able to emulate "real paint mixing characteristics", but for simplicity, I am trying to find a method where the resultant looks intuitively like what you'd get from combining the two source rgb's...

Looking for novice book on combinatorics

I am looking for books on the math & computing applications of Combinatorics. Let me know your favorite books on this topic. Thanks. ...

sum of series 1*3-3*5+5*7

please help to print series as well sum of series like 1*3-3*5+5*7 up to n terms i have used code like this in php class series { function ser(){ $i = 0; $k = 3; $m = 0; for($j = 1; $j < 3; $j++) { if($j % 2 == 0 ) { $m = $i + ($i * $k); } else { ...

redistributing application with NAG math libraries- client must have license?

Has anyone dealt with re-distributing an application that uses the Numerical Algorithms Group (NAG) Libraries? It seems like when I build an executable, it won't run unless I have an environment variable set for the license file- i.e. if I gave someone the code they would need a license and associated daemon as well. Is there no way a...

AMN and math logic notation

I'm not sure this is appropriate for stackoverflow, but I don't know where else to ask. I'm studying the B-Method for proving consistence in requirement specifications, and I have an issue with the logic math notation when specifying the pre conditions of the operations. Simplifying the original problem, I have a variable which is a sub...

Moving from web generalist to some particular specialization. Any suggestions?

I've kind of asked this before but I don't think I asked it properly, so I'm changing it up and hopefully I should get better responses. I'd like to change the nature of my day job, Rails, with something that requires more thinking, something that requires math hopefully. I'd really like for the change to be gradual. That would help my ...

Maximum length of a decimal latitude/longitude Degree?

What is the maximum length (in kilometers or miles - but please specify) that one degree of latitude and longitude can have in the Earth surface? I'm not sure if I'm being clear enough, let me rephrase that. The Earth is not a perfect circle, as we all know, and a change of 1.0 in the latitude / longitude on the equator (or in Ecuador) ...

as2 tweening and consistent speeds

I'm tweening a movieclip from startX to finishX. The value of startX varies but finishX is a constant. But as the startX increases in value the animation appears to be quicker. How do I adjust the speed of the tween to ensure a consistant speed regardless of the value of startX? Thanks ...

Are there any matrix math modules compatible with Python 3.x?

When I began this project, I thought it would be easy to get libraries for common stuff like matrix math, so I chose to work in Python 3.1- it being the most recent, updated version of the language. Unfortunately, NumPy is only compatible with 2.5 and 2.6 and seems to be the only game in town! Even other stuff that I turned up like gam...

Triangle - Triangle Intersection Test.

I'd like to know if there is out there some tutorial or guide to understand and implement a Triangle-Triangle intersection test in a 3D Environment. (i don't need to know precise where the intersection happened, but only that an intersection has occurred) I was going to implement it following a theoric pdf, but i'm pretty stuck at the ...

Is there a standard sign function (signum, sgn) in C/C++?

I want a function that returns -1 for negative numbers and +1 for positive numbers. http://en.wikipedia.org/wiki/Sign%5Ffunction It's easy enough to write my own, but it seems like something that ought to be in a standard library somewhere. Edit: Specifically, I was looking for a function working on floats. ...

Can 12.1 be represented exactly as a floating point number?

This is in reference to the comments in this question: This code in Java produces 12.100000000000001 and this is using 64-bit doubles which can present 12.1 exactly. – Pyrolistical Is this true? I felt that since a floating point number is represented as a sum of powers of two, you cannot represent 12.1 exactly, no matter how many...

Simple number pattern to store combinations as a unique sum

This is a math problem, but I'm sure this must come up in some programming scenarios, at least I hope so, and I was wondering if there was a name for this type of situation: Suppose I have 7 items in a series. For the sake of this example, let's use days of the week. I would like a user to submit which days of the week they plan to come...

C#: generic math functions (Min, Max etc.)

Hello. I was thinking about writing generic functions for basic Math operations such as Min, Max etc. But i i dont know how to compare two generic types : public T Max<T>(T v1, T v2) where T: struct { return (v1 > v2 ? v1 : v2); } How about that? Thank you. ...