/*
File Name: MathGOC.h
Created By: Andy Odle
Date: Mar 10, 2010

Description: 
*/

#ifndef MathGOC_h
#define MathGOC_h

#include <math.h>

#define pi 3.141592

struct PointGOC
{
    float xCor_m;
    float yCor_m;
    float zCor_m;
};

struct RectangleGOC
{
    PointGOC topLeft_m;
    PointGOC lowerRight_m;
};

// Calculate the nth fibonacci number.
// Formula:
//          Fn = Fn-1 + Fn-2
//   where F0 = 0 and F1 =1 and n is positive.
// 
double Fibonacci(int nth_p);

// Square a number.
// Formula:
//          result = x * x
// 
double SquareANumber(float num_p);

// Calculate the distance between two points.
// Formula:
//          d = sqrt ( (x2 - x1) ^ 2 + ( y2 - y1 ) ^ 2 )
// 
double Distance(PointGOC &point1_p, PointGOC &point2_p);

// Convert radians to degrees.
// Formula:
//          deg = radians * ( 180 / pi )
float ConvertRadiansToDegrees(float radians);

// Convert degrees to radians.
// Formula:
//          rad = degrees * ( 180 / pi )
float ConvertDegreesToRadians(float degrees_p);

// Calculate a new point rotated around 
// a center point given a angle of rotation.
// Formula:
//          d = Distance between center point and the point to rotate.
//          newPoint.xcor = cos( theta ) * d
//          newPoint.ycor = sin( theta ) * d
// 
PointGOC RotateAPoint(float angle_p, PointGOC &pointRotateAround_p, PointGOC &pointToRotate_p);

#endif
