Back to General discussions forum
I've solved the problem for accurate movements. (like 7.00000000 3.00000000 0.00000000 Can you explain to me how you get numbers that gives you movements, that are not accurate decimals? Should i multiply them with something? thanks
Stefan, Hi!
>Should i multiply them with something?
I think the main idea was that for any of six directions you can write what is shift by X
and by Y
like this:
dX dY
A: 1.0 0.0
B: ... ...
... ... ...
etc. And then simply sum up these dX
s and dY
s for all steps. Then the total distance is calculated
by Pythagor's theoreme as hypotenuse of triangle with sum(dX)
and sum(dY)
sides.
As about calculating dX
/dY
-s for other steps, you can see, for example, that path BFD
is a
triangle with all sides equal to 1.0
and all angles of 60
degrees. Plot it and you will see that
our wanted shifts are either sines or cosines of 60
degrees (multiplied by the length of the side
which is 1.0
anyway).