Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
I was a very happy bunny when I twigged that instead of calculating the sine and cosine of angles, I could have a simple lookup array [0..90] and use that with integer degree angles.
It's good enough for plotting curves on a monitor. Or was, for whatever it was I was writing at the time in 1984. (Which ran on a terminal on a DMS HiNet network.)
Indeed - that's an epic win
It also means that you can use polar geometry to create apparently complex movements of your entities with nothing but lookups - the arcade game Moon Cresta had some excellent enemy motion patterns achieved using the simplest code and a little precalculation
Although using pseudo-degrees in the range 0 - 256 for full circle and then ignoring the least two significant bits was usually good enough for games - 64 directions was more than enough for a 256*192 display (or even 320*256), although it was worth using an error-accumulating internal value to keep things smooth.
It's all just fixed-point arithmetic, really - which is of course essential for many other purposes, including financial calculations. What we need is a currency based on 256 cents to the byte
It's all just fixed-point arithmetic, really - which is of course essential for many other purposes, including financial calculations. What we need is a currency based on 256 cents to the byte
What would we call the units? We can't call them 'cents' because they're not hundredths.
Comment