Click here to Skip to main content
15,892,674 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 Updated

Mathematics 

29 Apr 2010 by #realJSOP
CyberSamuraiii wrote:but left it up to us to figure out why and how it works.So, figure out why and how it works. If you can't analyze existing code, you'll absolutely suck as a programmer.
2 Feb 2022 by 1298201
#include #include using namespace std; class payroll { private: string name; int day; int rate; int ot; int otrate; int sss; int phil; int pgibg; public : int get_info(); ...
26 Aug 2014 by _Asif_
I can't recognize the mentioned math. The simplest way to calculate two points distance isfloat GetDistance(float X1,float Y1,float X2,float Y2) { float dx = X1 - X2; float dy = Y1 - Y2; return (float)sqrt(dx * dx + dy * dy); }Check this Distance...
2 Feb 2022 by _Asif_
It seems * you just copy the code from some website, incorrectly paste it * press F5 (run). * Got Compiliation Error * You came on Codeproject, paste the code again and asking to solve the problem, without putting any efforts at all. My...
22 May 2014 by Aarti Meswania
you can do this way...store formula in sql table tblFormulas like below...FormulaName FormulaEquationGain S.P. - C.P.Loss C.P. - S.P.Gain% (GAIN * 100)/C.P.Loss% (LOSS * 100)/S.PSelling Price (S.P) ((100 + GAIN%)/100)*C.P.Now...Write...
21 Jan 2014 by Abdelrahman Elzedy
A brief overview on mathematical implementations with programming language
21 Mar 2011 by Abhinav S
Did you check out wiki on this[^]?
8 Feb 2014 by Abhinav S
Its possible with bitwise operations.You can find some implementations if you search on the internet.
7 Jun 2013 by Ahmed Bensaid
Hello,I think you'll need to raise the exception yourself like this :if ((double.IsInfinity(result)) || (double.NaN(result))) { throw new ArithmeticException();}
4 Nov 2016 by Akhilesh Chauhan
suppose I have to accept an mathematical expression in a string format from the user, like e.g. 2*5 or 9/5+9 or 91-10+82/3 and so on. It can be of any length. It works if I have single length operand like 3+9-5*4/2 by some change in my below code it works fine. but fails if i give it more then...
4 Nov 2016 by Akhilesh Chauhan
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplicationExpressionUsingWhileLoop{class Program{ static void Main(string[] args) { char[] arrOne = new char[100]; int[]...
16 Dec 2013 by Albert Holguin
Your question is too general... there's a huge number of signals that would fit into that spectral mask. Post more specific questions once you get started.So far what you know (from the picture): 0. Signal must be centered at 21MHz (common IF frequency) 1. 3dB bandwidth must be...
10 Dec 2010 by Albin Abel
Hi,I will give you a rough idea how it could be. By the way it is my own idea and not referring to any existing popular algorithm. When take two polygons which intersects there are some node (point) must be inside the other polygon. So on a loop find the point inside using the point in...
16 Feb 2011 by Albin Abel
Hi,The polygon you have shown in the picture is a concave polygon, which usually little difficult to sort, however the one you have shown is somewhat easy. Find the centroid of this polygon from the given points and from the centroid trace with increase in angle. From the centroid if two...
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...
4 Jun 2014 by Alexandr Stefek
The article depicts usage of functional programming for creating indefinite integral in form Func from delegate Func.
21 Jul 2014 by Alexandr Stefek
This article show another way to implement generic operators. Vector is in middle of attention.
12 Dec 2022 by All Yasser
Transfer a new matrix of elements in the given matrix as 3 elements. What I have tried: Transfer a new matrix of elements in the given matrix as 3 elements.
28 Nov 2020 by alley46
In the first step, divisibility to 4 for n = 1 must be provided. Then I get the question of whether 0 can be divided by 4. How do I go through this step? what should I do? how can ı prove that problem? What I have tried: ı tried; for n=1;...
3 Feb 2015 by andrea contoli
Presentation and testing of some procedural bitmap creation algorithms .
16 Dec 2010 by Andreas Gieriet
Depending on the amount of potential entries and the size of the ranges, you might consider to go a brute-force approach:--> Add for each number in the hash_insert(...) range a dedicated entry in the hash table.I.e. the hash_insert(...) function is a convenience function for multiple...
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...
8 Dec 2014 by Andreas Gieriet
These numbers have a name: Perfect Numbers. See Perfect Number[^].Calculate for each Marsenne Prime[^] P the corresponding perfect number N: N = P*(P+1)/2 = (2r-1) ˙ 2r-1 (where r is prime and 2r-1 is prime = Marsenne Prime).P = 3 N = 3*4/2 = 6P = 7 N = 7*8/2 = 28P...
28 Jun 2015 by Andreas Gieriet
In my schooldays, programming and math was always put in close relation.I never felt that this has any fundamental relation.Some people may argue that designing an implementing an algorithm needs mathematical skills. I'd say, expressing your thoughts is at least as important to describe an...
19 Dec 2015 by Andreas Gieriet
You need a start date of the calendar, a first weekday of the calendar, a strategy how to calculate the leap days (in general, leap days do not necessarily need to be at the end of a month and there may be more than one leap day (IIRC, some ancient calendars even had leap months)).E.g. the...
17 Dec 2012 by Andrew Rissing
A method for calculating a Fibonacci number without using loops or recursion.
16 Mar 2016 by Andrewpeter
Hi everybody,I need to solve a System of Ordinary Differential Equations (ODE) by Runge-Kutta-Fehlberg method. I know that algorithm only uses with an ODE which has a function with form y'=f(x,y). Now I want to enhance this algorithm with a system of ODE,...
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#[^]
18 Oct 2012 by AndySardina
In C + + is a class dedicated to work with complex numbers, which is part of its standard library, defined in the library complex. Using this will make you work easier because the class provides a set of functions to perform arithmetic operations on this set of numbers, in addition to the I/O....
22 Sep 2020 by angusmax
I have a long sequence of calculations (using variables of type "double") where some operations might result (depending on input values) in "NaN" or "Infinity".Since I don't want to add something like the following:if ((double.IsInfinity(result)) || (double.NaN(result))) {...}after...
7 Jan 2022 by Annaarddy
Genetic algorithm will work for generating random pairs
16 Feb 2011 by Anthony Mushrow
So you want to sort clockwise, but in the event that some points have the same angle from the start point (Wherever 0 degrees points) then you want to sort by what? Closest point to the center?Either way, they're just vectors so you can find the magnitude and angle and use both to sort the...
26 Mar 2022 by Antony Fritzelas
Hi! I am currently developing a custom algorithm that implements the Havel-Hakimi algorithm choosing a node randomly. Unfortunately I have run into a logical error that is hard for me to trace (since I am a beginner in programming).I would...
17 Aug 2012 by Anup Shinde
Its not PLSA, but please check the updated post belowwww.anupshinde.com/latent-semantic-indexing[^]
29 Jan 2018 by Arav Singhal
An introduction to all the math required to get started on your own 2D physics engine
29 Jan 2018 by Arav Singhal
The basics of spaces, transformations and bodies used in a 2D physics engine.
29 Jan 2018 by Arav Singhal
Representing shapes, worlds, and integrating forces and velocities in a 2D physics engine
12 Nov 2018 by Arav Singhal
Calculating the mass and inertia of a body and applying forces to it
6 Mar 2013 by arave0521
Hai. I was thinking how to evaluate mathematical equations based on user defined variable separately. for examplelet say user input (y4df +rew)/4dwcf*rtewhen user click evaluate, it will prompt user to input values for variables as belowy4df = ?rew= ?4dwcf=?rte= ?any suggestion...
28 Jul 2021 by aroman
A ray tracing project
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 article I briefly explore Density Functional Theory
21 Jul 2021 by aroman
This post also introduces VTK, The Visualization Toolkit
21 Jul 2021 by aroman
In this post we introduce the Fourier Transform and hint about some of its usages.
21 Jul 2021 by aroman
In this post I explore Lattice Boltzmann methods and build a related project
21 Jul 2021 by aroman
The subject of this post is Time-Evolving Block Decimation.
21 Jul 2021 by aroman
This post is about the relaxation method combined with a multigrid method applied on the Laplace equation.
21 Jul 2021 by aroman
In this post I implement a Density Matrix Renormalization Group program.
21 Jul 2021 by aroman
In this article I discuss and make a program about Hartree-Fock.
19 Dec 2014 by Artem Los
“Trits” instead of “bits” – A short introduction to balanced ternary
13 May 2020 by Askar Azhibaev
Calculating the pi number faster using a simple formula
10 Jan 2012 by AspDotNetDev
Since there is no time component, you are looking for the magnitude of the vector. You can get it as follows:M = Math.Sqrt(dx * dx + dy * dy)"dx" stands for "delta x", or the x component of the vector. "dy" is "delta y". You can compute dx given any two x points:dx = x1 - x2Same goes for...
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,...
23 May 2023 by Avtem
So, the goal of the program is: 1) get an equation from the user with one unknown as a std::string (e.g. "62 = x * 1000") 2) solve the equation and print the value of the unknown (denoted as "x") What I have tried: i found TinyExpr, which is...
2 Oct 2017 by aymanshebl
can any one give me a very illustrative example of dynamic time warping and how it works?, i am a beginner of this branch. thanks in advance What I have tried: i need a complete reference about dynamic time warping technique.
3 Oct 2010 by Baji Jabbar
Hi I am assuming the programming language as C#You can use Math.Pow() Function to accomplish this in C#. You can refer [this.]You can convert the equation to result with Math.Pow((x - a), 2) + Math.Pow((mx + c - b), 2) = Math.Pow(r,2); :) But your equation seems like it...
5 Apr 2013 by bEGI23
Convert filesize (bytes) according to highest possible size scale (KB, MB, GB, TB, PB).
18 Aug 2015 by Bharath K A
This is a HTML5 WebSocket service that streams live, real-time data to browser grid control. This service is capable of automatically computing math expressions on the fly (dynamically at runtime)
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...
10 Nov 2015 by BillWoodruff
I took a look at this Control, and its source (thanks to the JetBrains de-compiler); I'd say it's a very amateurishly coded Control; and, the author provides no read-me file, no link to source-code on GitHub or similar, no contact information.My sense is that what you want, here, is a...
14 Sep 2021 by BillWoodruff
See if this gives you some ideas: // requires: // using System.Collections.Generic; // using System.Drawing; // must be a top-level class: i.e., non-nested public static class ShapeExtensions { // rectangles returned in column-major order ...
16 May 2013 by BobJanova
The short answer is 'because that's what the standard says'; IEEE floating point defines infinities and NaNs, whereas the integer standards don't. Decimal, despite having a floating point in the most literal sense of that term, is based on the integer standards (and obviously long is a native...
18 Jan 2012 by Boon How
Hello everyone,I am trying to round up the decimal places of the values gotten from a dataset.I have tried to use Math.round but it could not work.Currently the decimal places is 17 and I want to round it up to 7 places.Is that some command I could use to round up the values...
6 Mar 2014 by BotCar
This looks promising.Alternatively, if you're willing to pay for it you can also have a look at this.
1 Feb 2011 by bowww
How do I show that log^kN is o(N) (small o) for any constant k. I am so confused with the derivative of log^kN .. i got k (logN) ^ (k-1) but I don't know what to do next. Lim n→ ∞ log^kN/Nthanks in advance
8 Apr 2010 by Brandon.T.D
:confused: X| i cant find it out haha can any one helpEdit TR: Fixed the tags. Not that I expect anyone to answer helpfully...
3 Oct 2011 by Brian C Hart
This tip illustrates a simple C# console program that uses the Sieve of Eratosthenes algorithm to quickly find prime numbers.
3 Mar 2011 by C.CoderCreator
This is what i have to doi need to evaluate this3 to the power of negative 2 whats the quickest and fastest way to do these and is there any tricks?
14 Oct 2012 by chaau
Replace your function to:// forward declaration:float trpse(int r,int c,float **a,float **atr);...// function definition:float trpse(int r,int c,float **a,float **atr){ int i,j; for(i=0;i { for(j=0;j { ...
7 Jan 2015 by CHill60
I think what you are looking for is "Bezier Clipping"Here is a link to a paper[^] on it but there may be better explanations via google now that you have the algorithm name :-)
24 Apr 2018 by CHill60
This looks like homework, which we will not do for you. It's also a very common homework task which is why a search-engine would have found you over 2 million options to look at. You might like to start with this CodeProject article Countdown Number Puzzle Solver[^]
22 Feb 2019 by CHill60
Try posting your question on this forum instead - Algorithms Discussion Boards[^] - Essayez de poster ceci sur cet autre forum You should also consider the thickness of the label and it's carrier paper Vous devriez également considerer l'épaisseur de l'étiquette et du papier support Bon chance
3 Apr 2014 by Chris Copeland
Using call stacks, rather than Regular Expression, to deconstruct mathematical formulae and calculate values.
24 May 2018 by Chris Guyette
What are the best non-programming books/topics (e.g on math, statistics, etc) that can help you become a better programmer? What I have tried: If you have some advices I will really appreciate that. Thanks
10 Nov 2015 by ChrisCreateBoss
Ok, so I have a circular progress control in my Windows Form.The circular control has a ProgressAngle property and a StartAngle property, both can be modified.The startAngle is set to 270. The ProgressAngle must change according to the mouse position within the MouseMove event in it....
29 Mar 2017 by CodeMine
in sql server i have a table called questionin that following fieldsquestion number question type question1 simple e=mc square2 complex a square plus b square rootover xhere question type can be simple and complexif question type...
9 Jun 2013 by compuknow
How can i deal with large numbers in C++. Example 26000 or numbers raised to the powers of any two large prime numbers.I am unable to process or store large numbers in C++. Is there any way to achieve that?
11 Jun 2013 by compuknow
I have the following expression for calculating the decryption key in a Public Key Encryption System :d = N-1 mod LCM(p-1,q-1)where N = p2q.I wrote the follwing code to find d ,long long int gendecrypkey(long long int modulo,long long int p,long long int q) { long...
27 Jun 2013 by compuknow
I am trying to perform the following operation :intgr[i]= getmod(power(*(str+i),a),b);The above code is an expression inside a 'for - loop'.where 1. getmod(x,y) = x mod y. 2. power(x,y) = x y.Here i use the exponentiation by squaring...
8 Jun 2010 by copperhead12
I would like to know a fast algorithm to find only the clique number[^] (without actually finding the clique) of a graph with about 100 vertices.Thank you.
30 Apr 2010 by CPallini
CyberSamuraiii wrote:The expression is absolutely beautiful in its simplicity and it works perfectly.I bet my 20 cents it does't work as it stands. :)
3 Oct 2010 by CPallini
As you probably know, with a bit of manipulation, your 'formula' maybe written A x^2 + B x + C=0That is a canonical quadratic equation[^], having a straightforward solution.
4 Oct 2010 by CPallini
A vertical line as equation x = Kwhere K is a const.Hence, you've to solve the original equation for y, namely:(K-a)^2 + (y-b)^2 = r^2That is, again, just a quadratic equation. :)
10 Oct 2010 by CPallini
Rounding, you lose precision (you cannot have it back again). :)
26 Aug 2011 by CPallini
In my opinion, you are using the wrong dFactor (it doesn't match the frequency decreasing rate -and the playback duration-). It should be dFactor = 1.0/m_waveHeader.nSampPerSec;
24 Feb 2012 by CPallini
Cannot you simply count events, based on a known property of the waveform (for instance crossing a given level)?
21 Mar 2012 by CPallini
How ('The Fresh Hell') a value could be at the same time greater than (or equal to) 100 and less than (or equal to) 1?All your conditions (and eventually your whole code) are going to fail.
10 Oct 2012 by CPallini
You should write something similar to:// a, b are IN parameters, while c is the OUT parameterint product(float a[20][20],float b[20][20], float c[20][20]){//... }and then , in the main function: //.. float a[r1][c1]; float b[r2][c2]; float c[r2][c2]; ...
6 Jan 2013 by CPallini
You might start reading some theory: Map projection at Wikipedia[^].
26 Mar 2013 by CPallini
This has little to do with UNIX. You need just a little knowledge of the C programming language and a bit of logic. How would you solve the problem with pencil and paper?
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);
10 Jun 2013 by CPallini
You need a library for big integers. Google[^] is your friend.[update]Have a look at the following Wikipedia pages:"IEEE floating point"[^]."Quadruple precision floating-point format"[^].There you may also find links to known implementations.[/update]
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
23 Sep 2013 by CPallini
From the wikipedia page:converges quartically to PI, giving about 100 digits in three steps and over a trillion digits after 20 stepsYou cannot obtain such a precision (100 digits) with double or decimal numbers.
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...
6 Feb 2014 by CPallini
Yes, of course int a = 5; int b = 10; int c = a - (-b);
8 Feb 2014 by CPallini
The "Bitwise operations in C" Wikipedia's page, provides an example[^].
13 May 2014 by CPallini
Finding if two rectangles overlap is not that dramatically difficult, namely if (((r0.x0 r1.x0) || ( r1.x0 r0.x0 )) && (r0.y0 r1.y0) || ( r1.y0 r0.y0 ))) { // overlap }You may use >= and