找到半径和角度的点 [英] Find the point with radius and angle

查看:28
本文介绍了找到半径和角度的点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是几何方面的天才,我想在 as3 中找到一个带有 radiusangle 的点,但是我不记得规则了,我知道这应该很简单!

I'm not a genius in geometry, I'd like to find a point in as3 with the radius and a angle but I don't remember the rule, I know this should be simple!

这是一个例子:

替代文字 http://img297.imageshack.us/img297/4879/examplepr.png

推荐答案

as3.x = centerX + radius * cos(angle)
as3.y = centerY + radius * sin(angle)

请注意,链接到的图片中的旋转是在负方向".即,角度增加,产生逆时针旋转.

Note that the rotation in the picture linked to is in the "negative direction". I.e, an increase of the angle, yields a counter-clockwise rotation.

这篇关于找到半径和角度的点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆