문제

I have seen many implementations for this but I got this new idea about which I couldn't be sure. So I need an opinion here.

The idea is that instead of looking up the table for arctan(gy/gx), look for 1/gx in one table and multiply the result with gy. Then lookup for arctan. The reason for doing so is to reduce hardware cost as division is more expensive than multiplication. But the limitation is that I can have a maximum of 10 address bits. Whereas, multiplication will give me twice the number of bits in gx. gx itself is 8 bits. If I right shift gy*(1/gx) by 6 bits to get a 10 bit address,

What could be the degree of error?

도움이 되었습니까?

해결책

Note you only need to consider the case when gy > gx as arctan(gy/gx)=90-arctan(gx/gy) (assuming we are working in degrees in positive coordinate). This might reduce you errors with division.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top