“镜像”一个角度
我需要获得一个角度的补角。
我真正需要做的是实现某种镜像角度的代码,比方说,我有 45 度 -> 45 度。 135,又如:80->100,0度->135 180,等等。
I need to obtain the supplement of an angle.
Exactly what I need to do is to implement some kind of code that mirror the angle, let's say, I have 45 degrees -> 135, another example: 80 ->100, 0 degrees -> 180, and so on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
我认为您正在寻找
180 - yourAngle
。您的示例:
I think you're after
180 - yourAngle
.Your examples:
减法可能会起作用(如果宇宙是欧几里得宇宙)。
http://en.wikipedia.org/wiki/Supplementary_angles
Subtraction will probably work (if the universe is Euclidean).
http://en.wikipedia.org/wiki/Supplementary_angles
根据您似乎要问的内容,最简单的答案是
The simplest answer, based on what you appear to be asking about is
如果将“角度”视为平面中的二维向量,则只需更改垂直于“镜像”平面的分量的符号即可。
因此,例如,在 yz 平面中“镜像”的 45 度角 (1, 1) 变为 (-1, 1)。
If you view your "angle" as a 2D vector in the plane, you simply change the sign of the component normal to the "mirror" plane.
So, for example, a 45 degree angle (1, 1) "mirrored" in the yz-plane becomes (-1, 1).
我正在玩我的一个绳索物理项目,并用它来镜像角度。
这适用于超过 360 度的值,因为模数运算会标准化您的角度,并且从 0 中减去该结果将水平镜像它。
I was playing around with a rope physics project of mine and used this to mirror angles.
This will work with values over 360 degrees because the modulus operation normalizes your angle, and subtracting that result from 0 will mirror it horizontally.