Questions tagged [math]

Mathematics is the study of quantity, structure, space, and change. Any math questions on this site should be programming related.

0
votes
0answers
8 views

Rotate line using ArcTan2 over the +- 180 degree boundary

I have a line witch rotates to the current mouse position with a set speed (x degree per calculation=rotating angle).I do this by calculating the current angle of the line and the target angle ...
0
votes
2answers
36 views

create_function in PHP gets depreciated

<?phpfunction compute($input){$compute=create_function('', 'return '.$input.';');return 0 + $compute();}$test=array('5 + 5','3 +( 2 * 3)','(3 + 2) * 3',...
-2
votes
1answer
20 views

What formula should be given to get the desired output

I am trying to solve a problem in which they have given a value and the output for the value is also given.I have tried to solve the problem but i can't able to do it.can anyone say what would be the ...
3
votes
2answers
48 views

Different combinations of groups of words in a sentence

I am trying to come up with an algorithm for determining all of the combinations of word groupings in a sentence (not breaking the order of the words). e.g. With this sentence: "the test case phrase"...
-4
votes
0answers
73 views

What's wrong with (-1)^0? [duplicate]

I tried it on multiple languages / multiple calculators & results are different.Google calculator (search request -1^0 or -1**0)=-1Python command line (-1**0)=-1Python command line (pow(-...
0
votes
1answer
24 views

How can I normalize trending data?

Say I want to calculate the velocity of two datapoints (A and A'), each having a score, and a time published (A' is a future version of A, and has a higher score). This would be [A'(score) - A(score)...
1
vote
1answer
38 views

Monte Carlo simulations involving mutiple probability

I have to create code that is supposed to display the probability of getting an ace of spades and then any 2. The main problem is that I can write code that displays the probability of getting an ace ...
0
votes
0answers
16 views

R: How do I quantify the similarity of two 2D binned density maps (heatmaps)?

I have two 2D binned density maps (heatmaps) according to hexagon binning, to show how many agents are there in one hexagon. These two binned density maps are from datasets with different size.How ...
1
vote
2answers
79 views

C# rounding of double not working [duplicate]

I have this code to round some value. I am using Math.Round() for the same.double h=128.015999031067;double d=Math.Round(h, 3) * 1000;result is 128015.99999999999if I write it to console it ...
6
votes
1answer
220 views

bind can be composed of fmap and join, so do we have to use monadic functions a -> m b?

I don't use Haskell a lot, but I understand the concept of Monads.I had been confused by Kleisli triple, and the category, however, fmap and joinAlthough Haskell defines monads in terms of the ...
2
votes
1answer
28 views

Color balance formula adding too much white

I am trying to write color balance, but I am having some difficulties with the math. I found this formula on WikipediaWhat I have done is the following:Get individual sums of all the reds, greens ...
-2
votes
0answers
44 views

A math example with can be code only by nested loops [on hold]

Here is the questionI tried to do that and my code is functional but I having some issues witch is I get always the same answer whether I change my code anything has not changed. Can anyone here to ...
0
votes
1answer
18 views

Android - Accelerometer fall detection algorithm

I'm trying to build an app for fall detection using the accelerometer of a smartphone as a school project.I was doing some research and I found this article with some calculations, so I'm trying to ...
-2
votes
0answers
40 views

c++ math MACD formula

I'm trying to make the MACD (moving average convergence/divergence) formula to work, I think the code is correct. Can anyone see if it is correct?#define lop(var,from,to)for(int var=(from);var<(...
0
votes
0answers
22 views

Estimate unit sales based on daily inventory

Understanding there is a margin of error, I'd like know the best way to estimate daily sales for an item based on inventory levels - simple if inventory doesn’t increase, but in this case, shipments ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,