Mail Archives: djgpp/1997/10/18/17:31:18
Joshua Hab wrote:
This is a problem with number types. The fragment "theta/360" is
taking an "int theta" and dividing it by the integer 360. The result
will be rounded to an _integer_ according to the ANSI C spec, and
because the answer is less than 1 this means the angle will always be
rounded to zero.
Try this: "theta/360.0*6.28" The "360.0" is now a _float_, so the
value of "theta" is made into a float. This allows the division to
give a fractional answer, and it should work.
(1st Year Maths/Computer Science Student)
- Raw text -