Skip to content
C++ C Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is the Worldforge math library. It's licensed under the GPL
(see file COPYING), and basic compilation instructions are in
the file INSTALL. The current maintainer is Ron Steinke

The primary focus of WFMath is geometric objects. Thus,
it includes several shapes (boxes, balls, lines), in addition
to the basic math objects that are used to build these shapes
(points, vectors, matricies).

The only library that WFMath checks for is Atlas, and it only does this
for the sake of some test functions. The only dependency on Atlas is
in the file atlasconv.h. This header file contains
some inline functions which can be used to convert the various
objects in WFMath to Atlas::Message::Object and back. This
header file will be installed whether Atlas is present or not,
but to use it you must of course have the Atlas headers installed.

Most of the library classes can be divided into two sorts. The
first kind are basic mathematical objects, whose members are all fundamental
types. The second kind are shapes, which implement the shape class
interface described in doc/shape.h. There are four classes of the first kind:

Vector<>	A basic mathematical vector
RotMatrix<>	An orthogonal matrix of determinant 1, useful for
		describing rotations.
Point<>		A point in space. This basic class also implements
		the shape interface in doc/shape.h.
Quaternion	A quaternion

The shape classes are:

AxisBox<>	A box oriented parallel to the coordinate axes
Ball<>		Ball<2> is a circle, Ball<3> is a sphere, etc.
Segment<>	A line segment, defined by its endpoints
RotBox<>	Like AxisBox<>, but it can be rotated to arbitrary
Polygon<>	A 2 dimensional polygon contained in a (possibly)
		larger dimensional space

The library also contains some probability-related functions,
as well as wrappers for system time and random number functions.

Anyone interested in contributing to this project should do three things:

1) Send me an email. This is mostly to let me know someone else is working
   with the CVS repository, so I can be careful about merging commits.

2) Look at the file doc/CLASS_LAYOUT, which specifies which member functions
   all classes should have, and what order they should appear in.
   This only applies to significant classes, not things like
   ColinearVectors in error.h, which is only there to be thrown as
   as exception.

3) Update the ChangeLog _every_ time you commit to CVS. This makes
   it possible for other people to have some idea what you're working on.

The documentation is at this point confined to the doc/CLASS_LAYOUT file
and comments in the code. There's also a sample shape class definition
in the file shape.h in the doc directory. This has comments about
what member functions all shape classes are supposed to have, and what they
Something went wrong with that request. Please try again.