[ 
https://issues.apache.org/jira/browse/GEOMETRY-14?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16640527#comment-16640527
 ] 

Matt Juntunen commented on GEOMETRY-14:
---------------------------------------

{quote}The name {{multiply}} seems strange; wouldn't {{compose}} be more 
appropriate?
{quote}
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)}}.
{quote}
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 {{vec.apply(transform)}}.
{quote}Doesn't {{createTranslation}} duplicate {{translate}}?
{quote}
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: https://issues.apache.org/jira/browse/GEOMETRY-14
>             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: https://github.com/apache/commons-geometry/pull/14



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to