Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #51091

Re: Beginner. 2d rotation gives unexpected results.

From Nobody <nobody@nowhere.com>
Subject Re: Beginner. 2d rotation gives unexpected results.
Date 2013-07-23 16:20 +0100
Message-Id <pan.2013.07.23.15.20.35.67000@nowhere.com>
Newsgroups comp.lang.python
References <0a905ff1-199c-4900-81e6-d9b7bb63bb44@googlegroups.com> <mailman.5004.1374585095.3114.python-list@python.org>
Organization Zen Internet

Show all headers | View raw


On Tue, 23 Jul 2013 15:11:43 +0200, Peter Otten wrote:

> The conversion to int introduces a rounding error that accumulates over 
> time.

Most floating point calculations introduce a rounding error. If the
calculations are iterated, the error will accumulate.

In general, you want to avoid accumulating entire transformations. E.g. if
you want a spinning object, maintain the cumulative rotation angle and
rotate the original points each frame.

If you must accumulate transformations, you need to actively work to
maintain any desired invariants. E.g. if a transformation is supposed to
be orthonormal (all axes perpendicular and of unit length), you should
renormalise it periodically, otherwise the lengths and angles will change
over time.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Beginner. 2d rotation gives unexpected results. enmce@yandex.ru - 2013-07-23 05:34 -0700
  Re: Beginner. 2d rotation gives unexpected results. Peter Otten <__peter__@web.de> - 2013-07-23 15:11 +0200
    Re: Beginner. 2d rotation gives unexpected results. Nobody <nobody@nowhere.com> - 2013-07-23 16:20 +0100
  Re: Beginner. 2d rotation gives unexpected results. David Hutto <dwightdhutto@gmail.com> - 2013-07-23 09:04 -0400
  Re: Beginner. 2d rotation gives unexpected results. Joshua Landau <joshua@landau.ws> - 2013-07-24 22:17 +0100
  Re: Beginner. 2d rotation gives unexpected results. Terry Reedy <tjreedy@udel.edu> - 2013-07-24 19:55 -0400

csiph-web