AffineTransform interpolation

B

bob smith

Is it generally possible to interpolate between two AffineTransform objects?

For instance, you may want to get the object that is midway between two AffineTransforms.
 
R

Roedy Green

For instance, you may want to get the object that is midway between two AffineTransforms.

I supposed you can create an Affine transform that uses the mean of
the parms of the two components. I think you would have to experiment.
 
K

Knute Johnson

Is it generally possible to interpolate between two AffineTransform objects?

For instance, you may want to get the object that is midway between two AffineTransforms.

It's been a long time since I've done any matrix math but I don't think
you can interpolate between transforms. Since a transform is a
multiplication does it even matter the order of transform if you do
multiples? You could rotate or translate half the distance.

I'm curious, what are you really trying to do?
 
J

Jeff Higgins

Is it generally possible to interpolate between two AffineTransform objects?

For instance, you may want to get the object that is midway between two AffineTransforms.
There was some discussion in "Linear Combination of Transformations",
Marc Alexa, 2002 available via Google Books. It was above my head
then and remains so now. David Eberly may have written some on the
subject. comp.graphics.algorithms has slowed to a crawl but some remain
to answer inquiries.
 
E

Eric Sosman

Is it generally possible to interpolate between two AffineTransform objects?

For instance, you may want to get the object that is midway between two AffineTransforms.

It's certainly possible to generate a transformation matrix
that is a weighted sum of two others:

[Mavg] = r * [Ma] + (1-r) * [Mb]

Alternatively, you could find a "geometric mean" as a matrix
whose square is the product of the two transformations:

[Mavg] * [Mavg] = [Ma] * [Mb]

(Note that the "matrix square root" is not unique. I don't know
how you'd decide which of many candidate root matrices to use, nor
how you might extend the idea to "weighted geometric means.")

Whether either of these satisfies your notion of "interpolate"
is something only you can determine.
 
L

Lew

Peter said:
For interpolation of transforms, the usual technique is to use quaternions.
They allow similar operations as matrix transforms, but are better-suited
to interpolation.

AFAIK, Java does not have built-in quaternion support, but it's just math.
If you can't find a third-party library for that, you can read up on it and
write your own without too much difficulty.

https://www.google.com/search?q=java+quaternion+library
seems to have some promising links.
 
K

Knute Johnson

Is it generally possible to interpolate between two AffineTransform objects?

For instance, you may want to get the object that is midway between two AffineTransforms.

Anybody remember the name of the programming language from the 70s that
had a bunch of built functions for things like matrix math? I think it
started with an A? School had a PDP 8 or 11 and it ran on that.
 
G

Gene Wirchenko

Anybody remember the name of the programming language from the 70s that
had a bunch of built functions for things like matrix math? I think it
started with an A? School had a PDP 8 or 11 and it ran on that.

BASIC?

HP 2000F BASIC had matrix functions. I only ever seriously used
it for array initialisation
MAT A=ZER
would zero array A. The matrix functions got dropped on any micro
BASICs I ever used.

Sincerely,

Gene Wirchenko
 
A

Arne Vajhøj

Anybody remember the name of the programming language from the 70s that
had a bunch of built functions for things like matrix math? I think it
started with an A? School had a PDP 8 or 11 and it ran on that.

APL?

Arne
 
M

markspace

Anybody remember the name of the programming language from the 70s that
had a bunch of built functions for things like matrix math? I think it
started with an A? School had a PDP 8 or 11 and it ran on that.


GraFORTH?
 
G

Gene Wirchenko


APL was my first thought for language, but I had never heard of
it on the hardware you mentioned.
It used to be described as the ultimate write-only language. I remember
it being said that Ken Iverson wrote a GUI style text editor in 25 lines
of APL, but was unable to understand it six months later.

Yow! That makes INTERCAL and Brainfuck mere pikers.

[snip]

Sincerely,

Gene Wirchenko
 
A

Arved Sandstrom

It used to be described as the ultimate write-only language. I remember
it being said that Ken Iverson wrote a GUI style text editor in 25 lines
of APL, but was unable to understand it six months later.

... also by Iverson!
As far as J (or K for that matter) is concerned, it doesn't take but
some regular use of the language to master the symbols; the mnemonics
are pretty decent, and the extra operations created by combination with
.. and : relate quite well.

*Because* the language is so concise you typically have much less code
that you have to look at in order to figure out what's going on. Not
necessarily so with a pass of execution spread out over umpteen classes
and methods in Java or C#.

As wit any other language there is poor code written in J and good code
written in J. Good variable names, and choosing explicit or implicit
control structures as best suited, and in general not being too clever,
lead to readable and maintainable J code.

AHS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top