how to find out the current moving amplitude/heading

30 views
Skip to first unread message

scs.s...@gmail.com

unread,
Jan 20, 2019, 10:30:03 PM1/20/19
to GAMA
Hi all,

I'd have a new question to ask: for my boats (still the boats, yes :) ) I would like to implement wind/wave directions and speed now and they should influence the boats direction/speed.

For that I would like to use resultant force (sin/cos) functions, but I would need the current angle/amplitude/heading (?), the boat is moving at, when moving towards a target (go_to).
Mathematically, in my formula this would be the alpha angle:

These are the basic formulas I would like to use, in order to splitt the resultant speed into the x and y speed:
F(x) = v*sin(alpha)
F(y) = v*cos(alpha)

Is there a way to find out, what the current angle of movement of an agent is?

Thanks a lot!
Sheba

Patrick Taillandier

unread,
Jan 22, 2019, 11:42:46 AM1/22/19
to gama-p...@googlegroups.com
Hi,

If you are using the moving skill, you can use the built-in attribute "heading" that gives the heading (angle in degree) of the agent.

Cheers,

Patrick

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at https://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

scs.s...@gmail.com

unread,
Jan 24, 2019, 12:32:17 PM1/24/19
to GAMA
Hi there, thanks for the fast answer. :)
Reply all
Reply to author
Forward
0 new messages