[Pharo-users] Calculate angle between two vectors (probably @Igor :)

MartinW wm at fastmail.fm
Wed Mar 19 03:49:03 EDT 2014


Nicolai Hess wrote
> This was of course wrong, I don't know what the
> other method computes, but not the angle between two vectors.

Yes i also wrote a test and i think my method is right.


Nicolai Hess wrote
> Now the question is, why do you think your method is wrong / the boids
> behave wrong?

When i use my method to calculate the field of vision the Boids always fly
from top left to down right and if i turn on the circling option, they crowd
in the bottom right quadrant.
If i give them a 360 degree field of vision by always returning true for
isInFieldOfVision they behave correctly. This means they fly in a nice
circle around the center and if circling is turned off, the swarm flies in
different directions each time you start the simulation.

Perhaps the problem is not the calculation of the angle but is in the
isInFieldOfVision: method...



--
View this message in context: http://forum.world.st/Calculate-angle-between-two-vectors-probably-Igor-tp4749351p4749697.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




More information about the Pharo-users mailing list