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-10-26
Revision:
7:a301b6123068
Parent:
5:5f75399596f3
Child:
9:10f360732eb0

File content as of revision 7:a301b6123068:

#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 max(char dir, int pos);