comp.lang.ada
 help / color / mirror / Atom feed
From: Eric Hughes <eric.eh9@gmail.com>
Subject: Subtypes to represent coordinate charts
Date: Sat, 22 Mar 2008 10:16:21 -0700 (PDT)
Date: 2008-03-22T10:16:21-07:00	[thread overview]
Message-ID: <afe80c59-6dc5-400b-a36b-434eba6f4a5b@u10g2000prn.googlegroups.com> (raw)
In-Reply-To: 15bxm1vkv9k10.1s13j5278f2xn$.dlg@40tude.net

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...@dmitry-kazakov.de>
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 transported 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



  reply	other threads:[~2008-03-22 17:16 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-18 19:08 Are there noticable differences in Ada acceptance by country? Mike Silva
2008-03-18 20:41 ` Pascal Obry
2008-03-18 22:58   ` Phaedrus
2008-03-18 22:25     ` Mike Silva
2008-03-18 22:50 ` Ludovic Brenta
2008-03-19 11:42   ` Thomas
2008-03-19 12:09     ` Ludovic Brenta
2008-03-19 12:51       ` framefritti
2008-03-20  4:37         ` gpriv
2008-03-19 12:16     ` Ludovic Brenta
2008-03-19 19:04       ` Tero Koskinen
2008-03-20  8:57         ` Jean-Pierre Rosen
2008-03-25 18:02           ` Tero Koskinen
2008-03-25 19:57             ` Gautier
2008-03-19 19:55     ` svaa
2008-03-19 21:14       ` Phaedrus
2008-03-20  4:52         ` gpriv
2008-03-20 20:22           ` Simon Wright
2008-03-20 20:48             ` Dmitry A. Kazakov
2008-03-20 22:17               ` Simon Wright
2008-03-20 22:59                 ` gpriv
2008-03-21  1:54                   ` tmoran
2008-03-21  4:16                   ` Jeffrey R. Carter
2008-03-21 16:41                     ` Simon Wright
2008-03-21 19:15                     ` gpriv
2008-03-22 14:00                       ` Maciej Sobczak
2008-03-21 16:39                   ` Simon Wright
2008-03-21 19:21                     ` gpriv
2008-03-21 21:11                       ` Adam Beneschan
2008-03-22  7:02                         ` Simon Wright
2008-03-24 18:01                           ` gpriv
2008-03-21  7:52                 ` Dmitry A. Kazakov
2008-03-22 17:16                   ` Eric Hughes [this message]
2008-03-21 16:44                 ` Simon Wright
2008-03-20 21:17             ` gpriv
2008-03-20  1:34       ` Ivan Levashew
2008-03-19  7:42 ` Thomas
2008-03-19 10:35   ` Peter C. Chapin
2008-03-19 21:21     ` Phaedrus
     [not found]       ` <13u3vq728nidu3b@corp.supernews.com>
2008-03-31  4:27         ` David Thompson
2008-03-31  5:40           ` DScott
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox