|
|
On 1/9/2016 5:57 AM, Jérôme M. Berger wrote:
> On 01/09/2016 10:09 AM, Mike Horvath wrote:
>> I have the following code which is supposed to generate a parabola and 5
>> toroidal rings along the parabola's shape. However, only 3 of the 5 tori
>> are showing up. For the life of me I cannot figure out why. Where did I
>> make a mistake?
>>
>> #if (mod(abs(t_cnt), 1) = 0)
>
> My bet would be floating point rounding errors and this line: due to
> rounding errors, t_cnt will take values like 2.9999999999 or 3.000000001
> which will cause the test to fail. Try to loop on integers (from 1 to
> 50) and use t_cnt/10 when computing coordinates.
>
> Jerome
>
That's a good idea, thanks!
Mike
Post a reply to this message
|
|