Flapping motion for ornithopter

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 ;

}

Welcome to the forum
How to get the best out of this forum - Using Arduino / Installation & Troubleshooting - Arduino Forum

Click on the edit post button down here :point_down: It looks like a :pencil2:
Then highlight your text and insert inside the code tags that look like <|> up here :fu:
You can format your codein the arduino IDE and there is also a 'copy for forum' button that will insert the code tags for you

After you add code tags, please state and explain your question.

See the link in the response above for instructions and hints.

The last two lines in the following construct are never executed and probably result in a compiler warning:

return sholderVertical;
return wrist;
return elbowRotation ;

I would like to see pictures for the ornithopter to be honest.

Have you played Dune 2 back in the day?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.