math

calculating pi through php

how to calculate value of pi in php till 100000 decimal numbers.. or may be more ...

aspect ratio a calculation

afternoon all. Iv'e come across some mathematical problems that im not too good at. does anyone know how to calculate the ratio for Height against width? Regards Phil ...

Java Math(s) Parsing API

Following on from my previous question, I was wondering if anyone knew of any free (as in beer, as in freedom would be nice but not essential) math(s) parsing libraries for Java. I found one called Jep which used to be open-source (ie: written by the community), but now costs $300 upwards (is this even legal?). Any help appreciated! ...

Intuitive 3D Math Resources

I have been trying to find some well presented and explained Vector and Quaternion resources recently to brush up on my 3D skills, and have been having some trouble. Most of the resources I have found tend skip over the high-level reason that performing a particular operation is useful, and dives straight into jargon and proofs that te...

Pick X points on a circle which are on screen in C#

Hi all, I have a few sets of information available to me, currently: position on screen (Point) orientation of point (double, say 15 degrees) distance (length from point) What I want to do is pick X (less than 6 I think) number of points in an angular spread facing the same orientation as the position with a distance of distance so ...

generate math equations on windows

looks for a server side script/app that can generate equation images from latex. and runs on IIS ...

How to write an enumeration of all computable functions?

Motivation: I'd like to be able to use toy functional programming in languages without first-order functions, by using natural numbers instead of functions. A universal function is a function f : N -> (N -> N), equivalently f : N * N -> N that enumerates all possible computable functions. In other words, there's a number k such that f(k...

Numerical integration in Java?

Are there any libraries for Java to do numerical integration? I did ask google but failed to find anything, so should I implement my own methods (like trapeze method, simpson's method or whatever, it's been some time since I had my numerical analysis class)? ...

AS3 using a Matrix to "scale" an object from its "center"

Hi all, Here's something I'm trying to figure out concerning display objects in ActionScript3 / Flex. Let's say you have a display object who's registration point is in the top left and you want to scale it from its center (middle of the display object), How could you easily acheive this with the flash.geom.Matrix class Thanks for you...

PHP calculation

I'm trying to output a value from xml this is what I do - <?php echo $responseTemp->Items->Item->CustomerReviews->AverageRating; ?> This outputs 4.5, but when I change it to the code below it displays as 8. Why isn't it displaying as 9? Thanks. <?php echo $responseTemp->Items->Item->CustomerReviews->AverageRating*2; ?> ...

Given a start and end point, and a distance, calculate a point along a line

Looking for the quickest way to calculate a point that lies on a line a given distance away from the end point of the line: void calculate_line_point(int x1, int y1, int x2, int y2, int distance, int *px, int *py) { //calculate a point on the line x1-y1 to x2-y2 that is distance from x2-y2 *px = ??? *py = ??? } Thanks fo...

What is the best algorithm for checking if a number is prime?

Possible Duplicate: Efficient storage of prime numbers Just an example of what I am looking for: I could represent every odd number with a bit e.g. for the given range of numbers (1, 10], starts at 3: 1110 The following dictionary can be squeezed more right? I could eleminate multiples of five with some work, but numbers that...

set of n-linear equations in matlab

I have some trouble on setting of n-linear equations in matlab.I don't know how can I declare in matlab.I need matlab code for setting of n-linear equations.. ...

Algorithm to find matching pairs in a list

I will phrase the problem in the precise form that I want below: Given: Two floating point lists N and D of the same length k (k is multiple of 2). It is known that for all i=0,...,k-1, there exists j != i such that D[j]*D[i] == N[i]*N[j]. (I'm using zero-based indexing) Return: A (length k/2) list of pairs (i,j) such that ...

Parsing to RPN two equations give same notation but have different answers

I've wrote a parser in PHP that converts a string representation of an equation to RPN based on feedback from an earlier question. Whilst testing it I found two different equations that parse to the same thing in RPN. Because they end up as the same thing in RPN when you solve them you get the same answer. 3 + 4 * 8 / (1 -5) 3 + 4 * 8 ...

Algorithm should I create a new thread?

Is there an algorithm that checks whether creating a new thread pays off performance wise? I'll set a maximum of threads that can be created anyway but if I add just one task it wouldn't be an advantage to start a new thread for that. The programming language I use is python. Edit 1# Can this question even be answered or is it to gener...

Position boxes like in Exposé

Hi! Does anyone know a way to locate rectangles to best fit a certain area? The rectangles can be scaled up to a certain limit, but they should keep their proportions. I basically want to rebuild Mac OS' Exposé: Picture Thanks, eWolf ...

Perpendicular on a line from a given point

Hi All, How can I draw a perpendicular on a line segment from a given point? My line segment is defined as (x1, y1), (x2, y2), If I draw a perpendicular from a point (x3,y3) and it meets to line on point (x4,y4). I want to find out this (x4,y4). Thankx. ...

How to implement this oscillation function

What would be a fast way to implent this osscilation function. A signature would look like this: public static double Calculate(UInt64 currentCounter, uint duration, uint inDuration, uint outDuration) And the result should be a double that as currentCounter advances, ossciates between 0 and 1. The osscialtion speed is defines by the d...

How find a variable value in MOD expression?

9 = 2^X mod 11 What is X and how do you find X? Its related to finding the plain text in RSA algorithm and I'm writing a C program for it. ...