Used for the Biorobotics Project: Calculates the position of the hands based on the shoulder rotations and vice versa.

Fork of compute by Erik Steenman

compute.h

Committer:
AeroKev
Date:
2015-11-03
Revision:
10:546ff4637306
Parent:
9:10f360732eb0

File content as of revision 10:546ff4637306:

#ifndef M_PI
#define M_PI           3.14159265358979323846
#endif
 
#ifndef lround
#define lround(var)    (long)(var+0.5f)
#endif

double calcGamma(double ApBp);
double calcOmega(double Apx, double Apy, double Bpx, double Bpy);
double homogenousX(double omega, double fPx, double fPy, double Apx);
double homogenousY(double omega, double fPx, double fPy, double Apy);
double calcTanDifference(double Ax, double Ay, double Bx, double By);
double calcLengthPoints(double Ax, double Ay, double Bx, double By);
double calcCosAngle(double line);
double calcTanDirected(double Ax, double Ay, double Bx, double By, double Ox, double Oy);
bool checkArm(double arm);
int rad2deg(double rad);
double deg2rad(double deg);
void Angles2Point(double alpha, double beta, double& Px, double& Py);
void Point2Angles(double Px, double Py, double& a, double& b);
int compute_max(char dir, int pos);