Click here to Skip to main content
15,885,546 members
Everything / Mathematics

Mathematics

mathematics

Great Reads

by William Hey
Classical number theories
by jurhas
A small simulator for a 6 axis articulated robot
by Ryan Scott White
A C# struct/class library for large Floating-Point numbers
by Gunnar S
Implementation of the Poisson Cumulative Distribution function for large Lambdas

Latest Articles

by Ryan Scott White
A C# struct/class library for large Floating-Point numbers
by Kenneth Haugland
Radiation from rectangular, circle and elliptic - shaped openings
by JorgeLuisOrejel
This article describes the implementation of Dijkstra's Smoothsort as a generic sorting algorithm in C#.
by Xavier Junqué i de Fortuny
Reduces/evaluates a real/complex math expression

All Articles

Sort by Score

Mathematics 

27 Feb 2024 by Ryan Scott White
A C# struct/class library for large Floating-Point numbers
8 Apr 2020 by Gunnar S
Implementation of the Poisson Cumulative Distribution function for large Lambdas
17 Feb 2015 by DrABELL
Educational software package for Microsoft Windows® 7/8 contains “5-in-1” School Math Calculators and Equation Solvers intended for students and educators
16 May 2021 by Kenneth Haugland
Showing the major stepping stones of the development of calculus and its precursors
15 Aug 2023 by Xavier Junqué i de Fortuny
Reduces/evaluates a real/complex math expression
9 Nov 2015 by Sander Rossel
Using Venn diagrams to visualize sets.
22 Jan 2017 by Miguel Diaz Kusztrich
A simple way to build a wide family of fractals
27 Nov 2017 by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
14 Mar 2016 by V.
Case study on how to solve a complex problem by dividing it into smaller problems.
13 Apr 2022 by Steve Hageman
A Python Library to help make properly scaled Fourier Transforms including utility functions
1 Jul 2023 by Ryan Scott White
A fast, possibly the fastest, square root function for Big Integers and Floats in C# and Java.
18 Aug 2014 by José Cintra
Some suggestions of algorithms for solving the Pascal Triangle, addressing iterative, recursive and functional paradigms
31 May 2016 by William Hey
Semi-Prime Ordered Sequences (Part 2) is the follow-on to “Exploring Computational Number Theory (Part 1)” and describes a process for ordering the semi-prime base sequences.
20 Apr 2010 by harold aptroot
Looks like this one:http://www.research.att.com/~njas/sequences/A061317[^]
31 Jul 2012 by Kenneth Haugland
How to calculate a reverbration time in a room
22 Apr 2018 by Mohammad Kazem Akhgary
Algorithm of gamma function with high precision using taylor series
28 Feb 2013 by AspDotNetDev
That is called a weighted graph (where each edge has a "cost"). The "cost" in your case would be the total time to travel from one node to the next (which can be calculated with the inputs you specified, speed and distance).You mentioned one possible solution already: Dijkstra's algorithm,...
6 Feb 2014 by CPallini
Yes, of course int a = 5; int b = 10; int c = a - (-b);
12 Mar 2020 by Mohammad Elsheimy
My C# implementation of linear algebra concepts (matrix elimination, multiplication, inverses, determinants, etc.)
13 Jun 2023 by Jack Devey
This post delves into the perplexing Monty Hall paradox, examining the probabilities associated with sticking or switching doors in the game scenario.
12 Mar 2024 by OriginalGriff
If I try your values I get what I expect:SELECT (487-556)/556 Gives me 0 as it is integer arithmetic.SELECT (487.0-556.0)/556.0 Gives me -0.1241 because it's floating point arithmetic. Check your data sources and make sure the types are what you...
13 Apr 2012 by Espen Harlinn
You'll find a pretty good answer here:http://www.cplusplus.com/forum/articles/3638/[^]Best regardsEspen Harlinn
28 Feb 2013 by velvet7
Hi,I have already seen a lot of methods to find the right path from point A to B. (Astar, dijkstra, etc.)Now what I am trying to solve is something else, and i don't know if anyone have ever done something like this before...I'll try to explain.Let's say I have point A, B, and...
27 Jun 2013 by nv3
I assume you are dealing here with big (multi-word) integers, as the context is encryption. If that is so you can make use of the fact that mod (a**b) = mod (mod(a) ** b)And that might be significantly faster if you use the multiplying approach for computing the power. Note that mod(a) is...
2 Feb 2022 by OriginalGriff
When your code won't compile, start by looking at the error message. Pasting the legible part code into an online C++ compiler and trying to compile it, gives the first errors as: main.cpp:56:9: error: no match for ‘operator
22 Nov 2016 by Miguel Diaz Kusztrich
Using R to explore complexity of time series generated by simple process
2 Dec 2017 by User 6679439
Library extending the .NET numeric support
20 Apr 2010 by Dalek Dave
Start at the beginning. Genesis 3.18 - Thorns also and thistles shall it bring forth to thee; and thou shalt eat the herb of the field;57 - Leads to a variety of bean related things.132 - 12th Heteromecic number, so may prove useful.I think the 20th must be 142857, a cyclic...
26 Aug 2011 by mbue
You cannot multiply the absolute time by the current frequency. You have to integrate the time for each time slice multiplied by the frequency factor.For example:double currAngle = 0;for(...){ uiSample = (SHORT)(32767.0 * sin(RAD(currAngle));//dTime += dFactor; dDescension +=...
3 Nov 2011 by Sergey Alexandrovich Kryukov
You need to use the structure BigInteger, see http://msdn.microsoft.com/en-us/library/system.numerics.biginteger.aspx[^]. It provides unlimited number if digits.This unit (the whole name space System.Numerics) was introduced in .NET Framework v.4.0. What if you need to use earlier version of...
21 Jan 2013 by Simeon Sheye
Beyond basic unit tests, how do you choose your tests and when are you done?
11 Jan 2014 by Andreas Gieriet
I strongly suggest to first get a "feeling" for the graph.1) sin(x) is periodically in 2⋅π and has roots every n⋅π (∀ n ∈ Ν0)2) sin(x) ≈ x (x much smaller than π/2)3) e-x goes monotoinc to zero (∀ x ∈ R, x ≥ 0)4) e-x has sample...
11 Jan 2014 by Andreas Gieriet
I'm not familiar with that method, but my understanding from reading some online documentation (e.g. http://en.wikipedia.org/wiki/Bartlett's_method[^], http://math.mit.edu/linearalgebra/ila0403.pdf[^], etc.) I come to the following conclusion:Bartlett's method basicalliy calculates a series...
1 Feb 2014 by CPallini
Quote:Are there also convex hulls for any dimension?From Convex Hull Wikipedia[^]a page:"Formally, the convex hull may be defined as the intersection of all convex sets containing X or as the set of all convex combinations of points in X. With the latter definition, convex hulls may be...
21 Jul 2014 by Alexandr Stefek
This article show another way to implement generic operators. Vector is in middle of attention.
2 Sep 2014 by Cryptonite
This code gives a solution to the Chinese Remainder Theorem using totients instead of the Extended Euclidean algorithm.
12 Dec 2015 by JinWenQiang
This tip is a brief introduction of Network Calculus. I used Matlab codes to show you the results and to explain how it works.
22 Jan 2021 by OriginalGriff
The Taylor series for sin(x) is simple: sin(x) = pow(x, 1) - pow(x, 3) / 3! + pow(x, 5) / 5! - ... But your implementation does two things: starts with -1 instead of 1, and makes it look a lot more complex than it needs to be. If you don't...
14 Jan 2024 by Kenneth Haugland
Radiation from rectangular, circle and elliptic - shaped openings
20 Apr 2010 by Keith Barrow
I don't know if this helps, but if you take the number, subtract the position in the sequence, then raise to the power of 1 divided by three you get a straight line.
30 Sep 2010 by Sauro Viti
No, you can't: to do it you need at least one of the side. To demonstrate my assertion think about this: take a triangle and its angles, then scale the triangle by an arbitrary factor, the three angles has not changed.In brief: by knowing the angles you can identify a family of triangles,...
1 Dec 2010 by Sauro Viti
To identify such points is quite simple:consider the point Pn and the two segments adiacent to the point; they are S1 = Pn - Pn-1 and S2 = Pn+1 - Pnnow consider the scalar and vectorial product of the two segments:S1 * S2 = |S1| * |S2| * cos(alpha)S1 ^ S2 = |S1| * |S2| *...
5 Jan 2011 by wizardzz
I don't know where the CP article is, but here's a great article. I think it was originally in a newsletter article regarding a meetup and memorial for one of the fathers of...
4 Mar 2011 by Dylan Morley
I'd say have a look at Autotune.Nethttp://channel9.msdn.com/coding4fun/articles/AutotuneNET[^]As you'll see, pitch detection is obviously vital to an autotune program, so that will help you with what you're trying to do.
18 Mar 2011 by Manfred Rudolf Bihy
This little elaboration will help you along the way: http://www.euclideanspace.com/maths/geometry/affine/aroundPoint/index.htm[^].It shows how to combine the rotation matrices with a translation to achieve the rotation about a given point. The page you found gives you the rotation matrices for...
11 Jul 2011 by Аslam Iqbal
Find the slope m=(x1-x2)/(y1-y1) and make a loop of x where y=mx+c (c=0). now get (x,y) for a range of x. I'm not sure about my equations. please check those are correct or not.Correct equations, given (x1, y1) (x2, y2):m = (y1 - y2) / (x1-x2);c = y1 - x1 * m; ...
12 Sep 2011 by Bill Anderson
Here's an alternative. This one uses the BitArray class in C# and does not use the % operator.static List SeiveWithoutMod(int candidate){ BitArray sieveContainer = new BitArray(candidate + 1, true); int marker = 2; //start int factor = 2; //start. sieveContainer[0]...
30 Sep 2011 by Bill Anderson
Hi,Thanks for the feedback for alternative #1 from above (and thank you, Jurgen Rohr for your suggestion! I replaced the "reset" line with:while (!sieveContainer.Get(++marker));factor = marker;Here is another algorithm that's slightly different. It's not as elegant an approach, but...
13 Apr 2012 by nv3
Espen has already contributed a good link regarding the rounding. Thanks Espen, that got my 5.The reason I post this solution is to make you aware that there is better algorithm for line drawing that you might not be aware of. It was invented by Jack E. Bresenham and is named after...
12 Jun 2012 by Sergey Alexandrovich Kryukov
In VB, the '^' operator is not exponent, but a power operator, N ^ p means Np, and "exponent" means ex, in VB it would be e ^ x:http://msdn.microsoft.com/en-us/library/zh100ckf%28v=vs.100%29.aspx[^]."Exponent" is a unary function, and there is no a unary operator for it in any language....
6 Jul 2012 by OriginalGriff
I would change it slightly, by putting a check digit either at the start or end of the number:If you use a (sum-of-digits plus digit-position-number) modulo 10 then your are unlikely to get the same check digit by a simple mistake. This would also protect against transposed digits: 12435...
5 Aug 2013 by Maciej Los
If i understand you well, you need to create 2 dimension array of chars (filled with 0 - zero), then to replace some chars with other (1 - one) to imitate a circle... The size of array should be calculated based on r (radius).Have a look here:...
5 Aug 2013 by CPallini
try:class Program { const int N = 20; static void Main() { char [, ] circle = new char[2*N+1, 2*N+1]; double phi, dphi = 0.5 / N; phi = 0.0; for (int y = 0; y
30 Oct 2013 by Ron Beyer
A better place to ask a question like this is Wolfram Alpha[^], ao forum dedicated to math nerds like this one is dedicated to programming nerds gurus.
24 Aug 2014 by José Cintra
Some suggestions of algorithms for computing the Fibonacci numbers addressing iterative, recursive and functional paradigms
1 May 2015 by David Catuhe
Today I am going to try to explain you how shaders in babylon.js work.
29 Jan 2018 by Arav Singhal
Representing shapes, worlds, and integrating forces and velocities in a 2D physics engine
26 Oct 2018 by José Cintra
Generic algorithm to generate mathematical sequences
15 Apr 2019 by Patrice T
Quote: When I run it against this only one issue is resolved, if anybody can tell me what i am doing wrong it will be greatly appreciated. About anything is wrong. import java.util.ArrayList; public class ResitCode { public int Fib_No(int position) { // here you receive the position...
21 Jul 2021 by aroman
This blog entry shares a project that computes the band structure of a crystal having the diamond/zincblende structure, for various elements.
21 Jul 2021 by aroman
In this post we introduce the Fourier Transform and hint about some of its usages.
20 Apr 2010 by Dalek Dave
We don't do homework questions, and certainly not ASAP.However, take 3, double it and add 12 to give 1818, doubled add 16 (four more than 12) to give 52Double it, add 20 (four more than 16) to give 132Continue along that line to yield 10485668 as the 20th iteration.Assuming that...
20 Apr 2010 by Luc Pattyn
namespace aLittleProblem { static class Program { [STAThread] static void Main() { Console.WriteLine("16020"); } }}:)
3 Aug 2010 by Tim-bot
Simple calculation to determin a value at a percentage along a bell curve. Also with an offcenter curve intersection thing....
28 Sep 2010 by Sauro Viti
You have to solve the following equation system:R * cos(ß) = X2R * cos(ß + Ө) = X1Then:R * cos(ß) = X2R * (cos(ß) * cos(Ө) - sin(ß) * sin(Ө)) = X1Now, divide the 2nd equation by the first:cos(Ө) - tg(ß) * sin(Ө) = X1 / X2Then:tg(ß) = (cos(Ө) - X1 / X2) /...
4 Mar 2011 by Albin Abel
Each piano key has unique frequency. So the frequency domain i.e fourier transformation helps to identify the pattern of the pure sound from noise. That pattern you could use compare the sound."Another thought I had was that a note should be more or less the same each time it is played. If...
8 Oct 2011 by Simon Bang Terkildsen
% - mod/ - divint i1 = 5 % 2; // i1 == 1int i2 = 5 / 2; // i2 == 2
3 Nov 2011 by WhiteKnightBRASIL
SOLVEDThx SAKryukov[^]Hey there! I need to make some BIG calculations using binomial coefficients[^]Ok, since vb.net doesn't have factorial nor binomial coefficient functions I've already done my own:Function fact(ByVal Number As Byte) As Decimal Dim i As Integer = 1 ...
13 Apr 2012 by User 59241
If you put this in the debugger which is the FIRST thing to do when debugging a program you will find floor() is working properly.The line yy[i+1]=floor(yy[i]+mm+0.5);does completely different things when you use floor() because yy[i+1] is dependent on yy[i].You...
2 May 2012 by Sergey Alexandrovich Kryukov
This is the very basic explanation:http://en.wikipedia.org/wiki/Analog-to-digital_converter[^].What happens from ADC to computer may vary. ADC can be a PCI card, it can be a part of stand-along device connected with one of the very many interfaces: Ethernet, serial port (such as RS-232),...
14 Jun 2012 by Roman Lerman
Hi,val = System.Math.Ceiling(val);Have a nice day
17 Jul 2012 by Rahul Rajat Singh
I think this is what you are looking forExpression Evaluator for C# based on Expression Tree[^]Just do the following using sample code in the above article:IParser par = new ExpParser();ExpEvaluator eu = new ExpEvaluator(par); string expresion =...
22 Sep 2012 by Sandeep Mewara
Here, have a look at these:Project Euler 26: Find the value of d
9 Oct 2012 by Wes Aday
printf("%f",c[i][j]);You have not declared "c" in this statment anywhere. To use c in main you have to declare it just like you did for a and b.product(a,b);Does nothing because you are throwing the result away.
15 Nov 2012 by Sergey Alexandrovich Kryukov
I did not check up the code, but why not using 2-dimensional arrays which better fit the nature of a matrix and greatly simplify indexing? Just in case:http://www.kavoir.com/2009/02/javascript-multi-dimensional-array.html[^].—SA
26 Mar 2013 by Jochen Arndt
This can be done using a C program calling standard C library functions only. Then this source would be OS independant.To do this with Unix shells passing the range on the command line, read about shell programming (especially passing command line parameters, conditions, and arithmetric...
2 Apr 2013 by CPallini
Quote:Please Help me, Where I did wrong....Here:Quote:rupees = decimal.Divide(rupees, totalAmt);Should be:rupees = decimal.Divide(rupees, totalAmt-vatAmt);
26 Jun 2013 by Hossein Montazeri
A class to conduct a lottery, based on different chances of winning for every participant
3 Jul 2013 by SBK.V1.0
I am developing a simulation software which involves solving around 10^8 simultaneous linear equations. Equations are sparse. I already made a prototype in which I implemented LU decomposition myself. But my implementation can only address less than 10^4 equation due to performance and memory...
27 Jul 2013 by Nelek
I had deleted the solution because I thought it was not "professional", but seeing your comments to other questions... I am getting it back from the Limbo. This is the text:Probably this is not going to be the best approach as well but... at least it could make it a bit easier. I am...
5 Aug 2013 by nv3
What you probably mean is a parameterized circle equation: Let variable t run from 0 to 2*PI in small increments and then calculate: double x, y; x = cos (t) * r; y = sin (t) * r;This will give you a set of coordinated for a circle around the origin with radius r.If you...
2 Dec 2013 by ExcelledProducts CEO
Closest latitude and longitude to a referenced latitude and longitude.
28 Apr 2015 by Sergey Alexandrovich Kryukov
You messed up everything. Let's see how equal temperament works.You are trying to create equal temperament based on having 2 intermediate micro-tones between tones of 12-tone European system. It it also pretty apparent that you use the equal temperament and A440 pitch standard as the base....
10 Jun 2015 by Andy Lanng
Nope. You may find an API but I'd write one myself.Look at the below example of how to parse arithmetic strings using stacked operators There may be a API you can pull out of it:Math Parser .NET C#[^]
11 Jun 2015 by Stefan_Lang
This has nothing to do with math. Consequently you don't need a math library, but an expression parser: https://www.google.ch/search?q=experession+parser&ie=utf-8&oe=utf-8&gws_rd=cr&ei=D4J5VZmaHoKQsAGDh6eYBw#q=expression+parser+C%2B%2B[^]The first hit on that search already looks promising....
17 Oct 2015 by José Cintra
Tips for creating mathematical cross-platform applications in JavaScript and display formulas and other content with MathJax and JQuery Mobile.
10 Nov 2015 by Patrice T
A simple Google research on longitude + latitude + bearing + distance leads you to...
17 Oct 2016 by Kerneels Roos
For the first post in this series I’ll present a solution to the 1⁄0, or binary version of this famous problem I designed in 2015.
20 Oct 2017 by OriginalGriff
Well... the debugger would show you the problem pretty quickly, but you should be able to see it yourself with a quick glance over the code. for (x = 1; x
12 Nov 2018 by Arav Singhal
Calculating the mass and inertia of a body and applying forces to it
21 Mar 2018 by CPallini
Yes, direction is affected. You should compute the horizontal and vertical components of the particle speed in the frame where the hit wall is the horizontal axys, invert the vertical speed component and then transform back to original axys.
3 Aug 2018 by OriginalGriff
I suggest that you two classmates get together: Nikhila Vemuri - Professional Profile[^] Member 13937492 - Professional Profile[^] Since you are both posting the same homework question ... And see if you can understand this together, because we do not do your homework: it is set for a reason....
1 Oct 2018 by Rick York
I tried your formula in my little test bed which uses VS17 and I got exactly the same results you did. I tried various values for the iteration count from 32 to 128 and all gave the same result. FWIW, above about 127 gives an NAN. I think you are running into the numerical limits of 64-bit...
3 Oct 2018 by Daniel Pfeffer
Writing a good mathematical library is very difficult. The library must not only give accurate results, but must also preserve other attributes, such as monotonicity (i.e. if the mathematical function is monotonic, your approximation should also be monotonic), odd/even behaviour (i.e. f(x) ==...
16 Nov 2018 by OriginalGriff
You don't show us what you do with the eventual value (in AL) but since it's just a variable unless you "add it to a column" it's not going to show. The first thing you need to do is break out the debugger and look closely at exactly what is happening when you run that code with your data: put...
22 Feb 2019 by Richard MacCutchan
OK, that is mathematics not programming.