
Instant Calculators allow web-based users to make quick numerical calculations, including the creation of graphs and tables through any web enable application (including emails, websites, desktop gadgets and mobile phones). All the calculators seen on CodeCogs can be embedded onto another website using a short script. This makes them ultra flexible and very portable.
<iframe src="http://www.codecogs.com/ic-429&u=3" frameborder="0" scrolling="no" width="235" height="244"></iframe>
Instant Calculators, provide a simple and clean interface to a numerical calculation, allowing users to instantly make calculations without having to download or install any software. They can be embedded into any system that accepts HTML and can connect to the world wide web.
The code behind the calculators in all written in C or C++ and resides on CodeCogs. The enables complex calculations to be performed at speeds not possible through a standard website languages. The source code is not shared (unless you otherwise licence it) and it is impossible for the user to access it - so you retain complete control over your interlectual knowledge, design and idea.
You can create a new Instant Calculator any time, by merely submiting a function to CodeCogs at: http://www.codecogs.com/submit.php?mode=NEW
Once you have submited and confirmed the function, it will pass through our QA system and on acceptance will be compiled for use as an Instant Calculator. This process usually takes 1 working day.
Once active you can start using and sharing it.
Remember: If you wish to keep the content of your function private, you should select 'Private' under Licence Type.
To integrate an Instant Calculators into a website follow these steps:
Any component that is available as an instant calculator can also (at your discresion) be downloaded as an Excel add-in and used seemlessly from within Microsoft Excel (tested on Excel 2000 to 2003).
To illustrate how easy this is, consider this: You want to solve this well know dynamics equation in mechanics: . Returning the final velocity (v) for a given initial velocity (u) and acceleration (a) over the distance (s). First we need a slight rearrangement of the equation, i.e.:
Now we can write our code, but with these point in mind (n.b. colors of points are matched to code):
#include<math.h> double velocity(double u, double a, double s) { return sqrt(u*u + 2*a*s); }
If you now goto the Submission system and submit the above code, you'll see you first calculator generated. Remember it won't work immediately, it'll have to pass through our QA process first [Incidentally we're working to streamline this so calculators can go live immediately - but thats a few months off]
The previous example was very mathematic, but lets say you want a calculator that counts the number of letters in a sentence, how would this be done. There aren't any prebuilt routines in the C function library that achieve this so we'll have to write this all ourselves. Points to consider:
So now to the code (again note the colors that try to link the code to the above bullet points):
int lettercount(char* string) { int count=0; int i=0; while(string[i]!=0) { if((string[i]>=65 && string[i]<=90) || (string[i]>=97 && string[i]<=122)) count++; i++; } return count; }
Again goto the Submission system and see what happens.
As a general concluding comment. The submission system will try to create as much documentation as possible. But it can't possible know what you are ultimately trying to do. Therefore to make the instant calculator you create more user friendly, make sure you document at the very least each of the input parameters. You'll be asked for this information once you submit and move to the second page.