Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1702 - 1
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
2
 
3
#ifndef AP_MATH_H
4
#define AP_MATH_H
5
 
6
// Assorted useful math operations for ArduPilot(Mega)
7
 
8
#include <AP_Common.h>
9
#include <stdint.h>
10
#include "rotations.h"
11
#include "vector2.h"
12
#include "vector3.h"
13
#include "matrix3.h"
14
#include "quaternion.h"
15
#include "polygon.h"
16
 
17
// define AP_Param types AP_Vector3f and Ap_Matrix3f
18
AP_PARAMDEFV(Matrix3f, Matrix3f, AP_PARAM_MATRIX3F);
19
AP_PARAMDEFV(Vector3f, Vector3f, AP_PARAM_VECTOR3F);
20
 
21
// a varient of asin() that always gives a valid answer.
22
float safe_asin(float v);
23
 
24
// a varient of sqrt() that always gives a valid answer.
25
float safe_sqrt(float v);
26
 
27
// find a rotation that is the combination of two other
28
// rotations. This is used to allow us to add an overall board
29
// rotation to an existing rotation of a sensor such as the compass
30
enum Rotation rotation_combination(enum Rotation r1, enum Rotation r2, bool *found = NULL);
31
 
32
#endif