math

values from different fields in matalb

Hi does anybody familiar with a way that I could implement a matrix with values from a field (not the real or complex number, but lets say Z mod p). so I could perform all the operation of matlab on the matrix (with the values of the chosen field) Ariel ...

Learning Basic Mathematics

I'm going to just come out and say it. I'm 20 and can't do maths. Two years ago I passed the end-of-high-school mathematics exam (but not at school), and did pretty well. Since then, I haven't done a scrap of mathematics. I wondered just how bad I had gotten, so I was looking at some simple algebra problems. You know, the kind you lear...

Calculate coordinates between startpoint and endpoint

Given.. 1 - The start-point GPS coordinates, 2 - The end-point GPS coordinates, 3 - The speed at which the object is travelling, 4 - Knowing that the trip trajectory will be a straight line... How can I calculate what my GPS coordinated will be in n minutes' time? That is to say, how can I calculate my position at a given time after...

How do I know when to increase or decrease angle to get a specific angle?

Hi. I am programming a game and I have come to a very hard spot. Basically I have a circle and I have 2 angles on this circle. Angle 1 (A) is a point I want angle 2 (B) to go to. During my game every frame I need to check weither or not to increase or decrease my angle value by a certain amount (speed) to eventually reach the first angle...

What's a better choice for SQL-backed number crunching - Ruby 1.9, Python 2, Python 3, or PHP 5.3?

Criteria for 'better': fast in math and simple (few fields, many records) db transactions, convenient to develop/read/extend, flexible, connectible. The task is to use a common web development scripting language to process and calculate long time series and multidimensional surfaces (mostly selecting/inserting sets of floats and doing m...

Calculate minimum moves to solve a puzzle

I'm in the process of creating a game where the user will be presented with 2 sets of colored tiles. In order to ensure that the puzzle is solvable, I start with one set, copy it to a second set, then swap tiles from one set to another. Currently, (and this is where my issue lies) the number of swaps is determined by the level the user i...

simple rank formula

I'm looking for a mathmatical ranking formula. Sample is 2008 2009 2010 A 5 6 4 B 6 7 5 C 7 8 2 I want to add a rank column for each period code field rank 2008 2009 2010 2008 2009 2010 B 6 7 5 2 1 1 A...

Function to get X, Y position of an object orbiting a point, given a distance and angle in radians?

I am trying to code a function for a camera that orbits a point. Assume a 3d coordinate plane where Z is up. Ignore Z. Let's say the camera's position starts at (0, 0, z). The object to orbit is at, say (50, 50, z). So we have a distance of ~70 units. Calling the function with {(50, 50, z), 70, x} where x is the position in orbit, in ra...

MKL Accelerated Math Libraries for Java...

I've looked at the related threads on StackOverflow and Googled with not much luck. I'm also very new to Java (I'm coming from a C# and .NET background) so please bear with me. There is so much available in the Java world it's pretty overwhelming. I'm starting on a new Java-on-Linux project that requires some heavy and highly repetiti...

An efficient way to compute mathematical constant e

Hello, The standard representation of constant e as the sum of the infinite series is very inefficient for computation, because of many division operations. So are there any alternative ways to compute the constant efficiently? Thanks! EDIT After following some of your links, I believe that efficiency comes from a technique called bi...

WPF Coordinates of intersection from two Line objects

I have two Line objects in C# WPF, and I'm trying to construct a method to work out the coordinates at which the lines intersect (if at all). After giving myself a headache reminding myself of high school maths to do this, I can't work out how to map it into programming format - anyone know how to do this? Thanks very much, Becky ...

Finding the nth number of primes

I can not figure out why this won't work. Please help me from math import sqrt pN = 0 numPrimes = 0 num = 1 def checkPrime(x): '''Check\'s whether a number is a prime or not''' prime = True if(x==2): prime = True elif(x%2==0): prime=False else: root=int(sqrt(x)) for i in range(3,root,2): ...

Double type returns -1.#IND/NaN error when calculating pi iteratively

I am working through a problem for my MCTS certification. The program has to calculate pi until the user presses a key, at which point the thread is aborted, the result returned to the main thread and printed in the console. Simple enough, right? This exercise is really meant to be about threading, but I'm running into another problem. T...

Math for a geodesic sphere

I'm trying to create a very specific geodesic tessellation, but I can't find anything online about it. It is normal to subdivide the triangles of an icosahedron into triangle patches and project them onto the sphere. However, I noticed an animated GIF on the Wikipedia entry for Geodesic Domes that appears not to follow this scheme. Geod...

Reverse engineering a bezier curve

Given a few sample points on a bézier curve, is it possible to work out the set of possible curves these points may lie on? In my specific application there is a limited set of endpoints the curve may have, so I want to generate the set of possible curves, enumerate all of them and pick out all the ones which may end on a valid end poin...

Fit a logperiodic function to data set in flex

I wahnt to fit a function to a data set. The function formula looks like this: http://docs.google.com/fileview?id=0B_6wV4xlS6wCNTA2MzU2MTMtMWMwZC00NzNjLTg1MjktYzc4MzFkOTk5YzJh&hl=en" I fited the power function following this advice: stackoverflow.com/questions/2984164/power-function-fit-to-data-set. I've done it like here: mathworld...

Ruby BigDecimal sanity check (floating point newb)

Hello, Hoping to get some feedback from someone more experienced here. I haven't dealt with the dreaded floating-point calculation before... Is my understanding correct that with Ruby BigDecimal types (even with varying precision and scale lengths) should calculate accurately or should I anticipate floating point shenanigans? All my va...

Shortest distance between points on a toroidally wrapped (x- and y- wrapping) map?

I have a toroidal-ish Euclidean-ish map. That is the surface is a flat, Euclidean rectangle, but when a point moves to the right boundary, it will appear at the left boundary (at the same y value), given by x_new = x_old % width Basically, points are plotted based on: * see edit (x_new, y_new) = ( x_old % width, y_old % height) Thin...

A function where small changes in input always result in large changes in output

I would like an algorithm for a function that takes n integers and returns one integer. For small changes in the input, the resulting integer should vary greatly. Even though I've taken a number of courses in math, I have not used that knowledge very much and now I need some help... An important property of this function should be that ...

how to reverse an angle

I am no mathematician, but I somehow got into game development as a hobby. Having never studied anything beyond basic math, I have a lot of trouble figuring out how to reverse the angle of something, facing to the opposite direction, among the X axis. One image says more than 1000 words though (specially uneducated words): http://img156...