开发者

Radial plotting algorithm

开发者 https://www.devze.com 2022-12-11 05:33 出处:网络
I have to write an algorithm in AS3.0 that plots the location of points radially. I\'d like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry cours

I have to write an algorithm in AS3.0 that plots the location of points radially. I'd like to input a radius and an angle at which the point should be placed. Obviously I remember from geometry coursework that 2(pi)r will give me an x on the point at the radius distance. The problem is I need to produce the x, y and the calculation is a bit more complicated.

A small push (or answer) would be wonde开发者_JAVA百科rful.

Thanks.


Conversion from polar coordinates (r,theta) to cartesian coordinates (x,y):

x = xc + r cos(theta)
y = yc + r sin(theta)

where r = radius and theta = angle in radians and (xc,yc) is the center of the circle
0

精彩评论

暂无评论...
验证码 换一张
取 消