Stormworks: Build and Rescue

Stormworks: Build and Rescue

评价数不足
Logic - Vector calculation (length & angle) (atan2 substitute)
   
奖励
收藏
已收藏
取消收藏
标签: v0.2.41
文件大小
发表于
更新日期
51.746 KB
2018 年 7 月 17 日 上午 2:54
2018 年 7 月 17 日 上午 3:10
3 项改动说明 ( 查看 )

订阅以下载
Logic - Vector calculation (length & angle) (atan2 substitute)

在 Tajin 的 1 个合集中
Logic Examples & Knowhow
54 件物品
描述
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://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1443342087