We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I am trying to track and object and determine the difference in angle by subtracting the previous angle from the current. Problem is it is too fast and I often get a value of zero. How can I put the variable 'previousAngle' into a list so that I can, for instance, subtract the previousAngle from 10 readings ago from the current angle.
I am very new to processing so please bear with me if I seem slow.
Many thanks.
Answers
You should start by posting your attempt here. If it's too big, make a model of the part you got problem with!
By your description, a Queue would be the best tool. Java got an ArrayDeque class for it! =:)
Hi,
You helped me identify the need to use array or float in a previous discussion: http://forum.processing.org/two/discussion/593/comparing-current-angle-of-tracked-pixel-to-previous-delay#Item_6 I am struggling to understand how to use either, I have read the reference entries for both and am none the wiser. I basically just need to slow the comparison between current and previous angles.
can Queue only retrieve the head of the queue?
Yup. a Queue adds to its tail and retrieves from its head! It's a FIFO structure, aka FCFS (1st come, 1st served). (~~)
A kewl demo using it: :ar!