logo back up home forward   further reading more topics »

Maths - Equations

An equation is a mathematical expression with an equals sign in it.

Other possible elements of an equation are:

These are explained below:

numbers

There are different types of numbers, for instance:

and these numbers may be coded in different ways:

Unless otherwise specified we usually assume that numbers are decimal.

variables

Sometimes an equation contains a number but we don't yet know its value, or we may want to apply the equation to a range of values.

An example of the first is using x as the unknown, for example,

x + 1 = 3

An example of the second might be an equation of a line:

y = 2 * x + 3

In general we use:

x, y, z for unknowns.

a, b, c for values which are not yet specified.

binary operators

The operators:

take the two numbers on either side and replace it by a single number.

unary operators

The operators:

apply to the number to the right. '-' inverts the number (subtracts from 0) '+' says the number to the right is positive (the default).

brackets

When we mix + and * then the answer we get depends on the order that we apply them.

For example

2 + 1 * 3

To clarify this we can put brackets around the operation to be applied first:

(2 + 1) * 3 = 9

2 + (1 * 3) = 5

If we don't specify which has precedence by using bracket then by default * and ÷ have precedence over + and -. So,

2 + 1 * 3 = 5

functions

A function takes one number and uses it to generate another number. For example the function sin() takes an angle as input and returns the ratio of opposite and hypotenuse in a right angled triangle.


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Engineering Mathematics - This book has been going for a long time and it is now in its 5th edition, so it is tried and tested.

 

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to the software project, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover Dark Basic Professional Edition - It is better to get this professional edition

cover This is a version of basic designed for building games, for example to rotate a cube you might do the following:
make object cube 1,100
for x=1 to 360
rotate object 1,x,x,0
next x

cover Game Programming with Darkbasic - book for above software

 

Can you help?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

Terminology and Notation

Specific to this page here:

 

program

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2008 Martin John Baker - All rights reserved - privacy policy.