我正在训练使用径向识别路标形状。我有形状的中心点,我必须找到 7 个径向线来识别图形。要找到 7 个径向线,我必须在 0º、30º、60º 和 90º 处找到点,如下图(图 a):
https://lh4.googleusercontent.com/-sFsGXGD9VGI/TqxRjwIoSPI/AAAAAAAAAD0/yUOhN7RNUhU/s445/radiais.png
问题是,我不知道如何找到与我的中心成 30º 的点。
看,在我的第一个实施中,我正在计算 5 个径向线(0º、45º 和 90º),如图 b:为了找到 0º 处的点,我做了:
//fix the y coordinate and increment x coord
for(x = center.x to width)
pixel(x, center.y)
为了找到 90º 的点,我做了:
//fix the x coordinate and increment y coord
for(y = center.y to height)
pixel(center.x, y)
为了找到 45º 的点,我做了:
//increment x and y coord in the same number
for(x = center.x, y = center.y to width, height)
pixel(x, y)
所以,我想知道如何访问 30º 和 60º 的点。
ps.:抱歉,还不能发图片!没有名声。