[英]map degrees to 0 - 360 in python
is it possible to map a value of rotation to be inside the range of 0-360 degrees? 是否可以将旋转值映射到0-360度范围内?
For example: 例如:
Is there an easy solution? 有一个简单的解决方案吗? Maybe in mathutils?
也许在mathutils?
best, chris 最好,克里斯
You can use the modulo operator %
for this: 您可以使用模数运算符
%
:
>>> print -10 % 360
350
>>> print 760 % 360
40
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.