Hope this is useful, this is my first attempt at programming.
Two simple functions that describe the movement of the wings of birds
ps
sorry i dont know how to format my code
//normal flight
float ellipticalMotion ( ) {
float A = ampletude;
float w = angle velocity;
int humerus = 30;
int radius = 30;
int carpus = 30;
float R = humerus + radius + carpus;
float cx = R - b;
w += 0.01;
float y = A * sin (w);
float dx = b * cos (w);
float x = cx + dx;
float Q1 = atan(y / x);
float h = y / sin (Q1);
float Q3 = acos ((sq(carpus) + sq(h) - sq(humerus + radius)) / (2 * carpus * h));
float Q2 = acos ((sq(humerus + radius) + sq(h) - sq(carpus)) / (2 * (humerus + radius) * h));
float sholderVertical = Q1 - Q2;
float wrist = Q1 + Q3;
float elbowRotation = cos ( angle velocity);
return sholderVertical;
return wrist;
return elbowRotation ;
}
// hovering
float curveMotion ( controls() ) {
float A = ampletude;
float w = angle velocity;
int humerus; //LENGHT
int radius;
int carpus;
float R = humerus + radius + carpus;
float Sz = A * sin ( w + PI / 2 );
float Sy = B * sin ( 2 * w );
float sholderVertical = Sy / R;
float sholderHorizontal = Sz / R;
float elbowRotation = cos ( angle velocity);
return sholderVertical;
return sholderHorizontal;
return elbowRotation ;
}