# Problem[Animation/maths] "Aiming" at an arc

#### N_Molson

Donator
So I'm trying to code a landing leg animation so that the 2 "front legs" and the third "back leg" rotate at the same time. To be more specific, I want the end of the third leg to be at the base of the "foot" during the whole animation. So I coded a child translation animation so that the "back leg" jack extends as the leg rotates around "pivot 2", it works. The problem is the rotation rate of that back leg. It can't be linear, else the jack won't stay at the base of the foot and it looks weird. Instead, the rotation speed of the "back leg" anim should follow a curve that matches the arc described by the "front legs" rotation (centered around "pivot 1" and of radius r).

I lack the mathematical tool to do this, so anyone has an idea ? I'm sure it can be done, all I need is a mathematical function that controls the speed of the "back leg" rotation.

Here's a small drawing, I hope it helps understanding my problem :

Many thanks for helping !

#### kuddel

##### Donator
Donator
Shouldn't it just be:
For each step, calculate the vector from pivot1 to end of vector "r"? Length and direction of that vector should fall out of that, right?
A function describing this however is something I am not too good at

#### Urwumpe

##### Not funny anymore
Donator
Well, just draw the resulting situation in 2D and look for a mathematical problem that is similar, what will you find?

As you can see, its all about Thales and Pythagoras now.

And as you can also see, the important battlefield of your problem is the length a in the middle.

You can now happily apply trigonometry to solve the problem for getting the angle alpha

#### N_Molson

Donator
@Urwumpe : What I don't get is that you seem to depict a particular case, where "pivot 2" is located on the blue arc of radius r. I don't think it is the case.

I assume that the small white line is for the forward legs, and the small "l3" one is for the back leg ?

I probably just don't get it, can you enlighten me just a little bit more ?

Edit : this is what I get in 2D "side view" where

s can vary in lenght (variable). r is a constant. Angles a, b, c are variables.

s and r must join in x, which is a point that moves along the arc (here, in the counterclockwise direction).

p1 and p2 are the pivot points respectively for s and r.

d = 0.340332 m
r = 0.613203 m

what I need to know is the value of angle c, and the lenght of s so that the above conditions are met when x moves along the arc.

Last edited:

#### Urwumpe

##### Not funny anymore
Donator
Just mirror the drawing over the vertical axis... Also, isn't p1 fixed and r constant? If yes, all possible positions of x will be on a circular arc of radius r....