On Thu, 20 Mar 2008 22:17:18 +0000, Simon Wright wrote:
> Why would things be different if there were rotations involved?
On Mar 21, 1:52 am, "Dmitry A. Kazakov" <mail...@[EMAIL PROTECTED]
>
wrote:
> Because with rotations coordinates become linear combinations with
> dimensionless coefficients. (The rotation matrix is a matrix exponent so
> that cannot be made dimensioned.)
The coordinates of the transformation matrix are indeed dimensionless
(on balance, see below), but the coordinates of the vectors themselves
can well be dimensioned. Doing it this way can require type
conversions, but not always, depending on what operation the
application of a rotation matrix represents. The two prototypical
meanings of the mathematical expression are these: (1) dynamic motion
of a vector within a single coordinate frame and (2) coordinate
conversion of a vector between two overlapping coordinate charts (as
with the definition of a manifold, among others). In the first
application, there's no coordinate conversion. In the second, there
is. The underlying mathematical computations are identical, yet
significantly for a software implementation, the types of these
operations are different.
When dealing with multiple coordinate charts, the good reason to
require chart-specific types is that coordinates change their meaning
when trans****ted from one coordinate frame to another. For example,
if a coordinate pair represents a point, and the pair (1,1) represents
point P in frame A, then (1,1) won't represent point P in frame B
(except degenerately). So if you have a type Point, the right sort of
declaration looks like this:
type Point_in_A is new Point ;
type Point_in_B is new Point ;
package Convert_from_A_to_B is new Frame_Conversion( Domain =>
Point_in_A, Range => Point_in_B ) ;
The package Frame_Conversion would contain all the necessary type
conversions. Presumably it's an entirely pragma(Inline) library.
Having said all this, a transformation matrix that converts between
coordinate frames as above has units (meters in B)/(meters in A). On
balance, this is dimensionless, but there are context-specific units
hiding behind the scenes. Thus even declaring such a matrix should
have a declaration that captures these types. The package
Frame_Conversion is a natural source for such types toward this
purpose.
Eric


|