Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetLogo: Changing a heading to the opposite value

Tags:

netlogo

I need to calculate how to reverse a heading within a NetLogo script e.g. a turtle has a heading of 0, I need to flip this to 180 so they travel in the opposite direction.

I've tried [360 - heading] with limited success.

like image 455
algorhythm Avatar asked Dec 31 '25 12:12

algorhythm


2 Answers

For the record heading - 180 works, of course, but if you want to be more "turtle centric", you could ask your turtle to rt 180.

like image 145
Nicolas Payette Avatar answered Jan 06 '26 22:01

Nicolas Payette


Ahh got it. I knew I was close

[heading - 180]
like image 29
algorhythm Avatar answered Jan 06 '26 22:01

algorhythm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!