Installation



Installation guides are provided for Linux and Windows:


Linux Instructions

These instructions should work on most Linux distributions.


0. Requirements

The only requirement is the g++ compiler version 4 or later. Under Ubuntu, you can get g++ by installing the build-essential package.


1. Compiling

Compiling is as simple as:

If you would like to install somewhere other than the default location, you can pass --prefix=/my_location to the configure script. The last step, make install, should be performed as root.


2. Linking

Link your program to mathhelper and the math library:

g++ MyProgram.cpp -lmathhelp -lm


Visual Studio Instructions

A Visual Studio 2010 solution is provided to build MathHelper, named MathHelper.sln.

It should produce two files: libmathhelp.dll and libmathhelp.lib. If building the debug version, they'll be called libmathhelp_d.dll and libmathhelp_d.lib.


Using MathHelper


Include

To use MathHelper, include MathHelper.hpp:

#include "MathHelper.hpp"


Namespace

All classes, enumerations and constants belong to the MHTypes namespace. They can be accessed either by adding the namespace:

using namespace MHTypes;

or by specifying the scope:

MHTypes::Point3D myPoint;


MHFloat

The MathHelper classes use a custom variable type called MHFloat for their calculations. By default, MHFloat is a double. If you would like to set it to a different level of precision, you can find the definition in MHSettings.hpp:

typedef double MHFloat;

Be sure to recompile MathHelper after changing MHFloat.











Back to Contents