Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Logic - Vector calculation (length & angle) (atan2 substitute)
   
Award
Favorite
Favorited
Unfavorite
Tags: v0.2.41
File Size
Posted
Updated
51.746 KB
17 Jul, 2018 @ 2:54am
17 Jul, 2018 @ 3:10am
3 Change Notes ( view )

Subscribe to download
Logic - Vector calculation (length & angle) (atan2 substitute)

In 1 collection by Tajin
Logic Examples & Knowhow
54 items
Description
A vector calculation logic that basically does atan2 and vector length in one go and only needs 6x6 blocks.
Input: X Y vector

Output:
- Vector length
- Vector angle (rad)
- Vector angle (deg)

Angle output is in (0 - 360 deg), with 0 beeing north.


I've tried a few variants and I don't think it can be done any smaller than this. (feel free to surprise me if you think otherwise)



For a variant that outputs the angle in compass-format (-0.5 to 0.5) look here:
https://steamproxy.net/sharedfiles/filedetails/?id=1443342087