commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Juntunen (JIRA)" <>
Subject [jira] [Commented] (GEOMETRY-14) AffineTransform?D Classes
Date Sat, 06 Oct 2018 02:19:00 GMT


Matt Juntunen commented on GEOMETRY-14:

{quote}The name {{multiply}} seems strange; wouldn't {{compose}} be more appropriate?
Yes, {{multiply}} does seem to expose the underlying matrix implementation. We could do {{compose}}
but then I think the API would be a bit more awkward, assuming that by {{A.compose(B)}} we
mean "perform B then perform A". For example, if we want to perform a series of transforms
in order {{A}}, {{B}}, {{C}}, and then {{D}}, we would need to do {{D.compose(C.compose(B.compose(A)))}}.
If we rename it to {{apply}} and define {{A.apply(B)}} as "take A and perform B on it", then
we can write the same series of transforms a {{A.apply(B).apply(C).apply(D)}}. I feel like
that's cleaner and better matches the behavior of the other methods, like {{translate}}.
{quote}{{tranform.apply(v)}} looks more natural than {{v.applyt(transform)}}.
I used {{transform.applyTo(vec)}} since that's typically how one talks about transforms operating,
ie, they are applied _to_ points and vectors. The vector and point classes have corresponding
{quote}Doesn't {{createTranslation}} duplicate {{translate}}?
They are similar but slightly different. {{translate}} is an instance method and applies a
translation to the current transform. This involves a matrix multiplication. {{createTranslation}}
is a static factory method for creating a brand new transform that performs a translation.
The matrix for this can be created directly; no matrix multiplication is involved. I would
have liked to have given them the same name but then the methods would conflict.

> AffineTransform?D Classes
> -------------------------
>                 Key: GEOMETRY-14
>                 URL:
>             Project: Apache Commons Geometry
>          Issue Type: New Feature
>            Reporter: Matt Juntunen
>            Priority: Major
>              Labels: pull-request-available
> We should create AffineTransform?D classes that implement matrix-based affine transforms.
They should have simple methods for creating translations, rotations, and scaling and calculating
the inverse.
> Pull Request #1:

This message was sent by Atlassian JIRA

View raw message