[Kstars-devel] Plans for threading in KStars
Daniel-Marian Baboiu
daniel.baboiu at shaw.ca
Wed Nov 9 03:34:27 UTC 2011
On Mon, 2011-10-31 at 00:57 +0400, Alexey Khudyakov wrote:
> EquatorialToHorizontal call contains 3 sincos calls and 1 cos, asin and
> acos call each. It's looks quite costly. But effectively it is just
> transformation between different reference frames and simply a rotation.
>
> I suppose that representation of point on sphere as two angles doesn't
> admit efficient rotation. But this is the case where quaternions should
> shine. In this case rotation is just multiplication by another quaternion.
>
> There is a lot food for thoughts. What is best representation of point
> on sphere? Are quaternions right solution? If they are how should we
> deal with addition degeneracy? (We have 2 degrees of freedom and unit
> quaternions which could represent rotations have 3). Do we have class
> set up right? (I think we are not)
Quaternions are adequate for rotations if the object is in rectangular
coordinates, and have advantages when composing rotations. For this
particular coordinate transform, quaternions have no advantage over
"traditional" coordinate transform. To use quaternions, the spherical
coordinates of the point have to be converted to rectangular, rotation
applied, and conversion back to spherical. These conversions account for
all trig calls, except for a sincos.
There is place for optimization by caching the sincos for latitude -
there is no point to call sin(lambda) and cos(lambda) for every point in
the sky. It would make sense to have these stored when current location
is initialized.
Daniel
More information about the Kstars-devel
mailing list