Okay, here we go, a Sine and Cosine function in GC Basic, and the table is stored in EEPROM to save program space. Also, I tightened the code up a bit in general. As usual, there are lots of comments in case you want to make modifications of your own. As before, the functions themselves are quite small. It's the demo program and LCD printout that takes all the yammering.
The arguments may be any positive, negative or zero value, of any size--this is completely general. The results are accurate to four decimal places.
It just occurred to me that the Sine and Cosine functions here would be ideal for adding a circle subroutine to the graphic LCD stuff that's been appearing lately.
Hi Gang,
Okay, here we go, a Sine and Cosine function in GC Basic, and the table is stored in EEPROM to save program space. Also, I tightened the code up a bit in general. As usual, there are lots of comments in case you want to make modifications of your own. As before, the functions themselves are quite small. It's the demo program and LCD printout that takes all the yammering.
The arguments may be any positive, negative or zero value, of any size--this is completely general. The results are accurate to four decimal places.
It just occurred to me that the Sine and Cosine functions here would be ideal for adding a circle subroutine to the graphic LCD stuff that's been appearing lately.
Anyway, here you go:
Thomas Henry
Very nice. If you agree I could add to the Help File.
Hi Anobium,
By all means, feel free to use it if it would be helpful!
Thomas Henry