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 Sun, 07 Oct 2018 05:03:00 GMT


Matt Juntunen commented on GEOMETRY-14:

{quote}Using it will bring all the advantages of a standard API.
I agree with using the standard API here. However, there are a couple of slight issues.
 # The transform classes are used to transform both points and vectors, but we can only choose
one to be the type for UnaryOperator. It should probably be points, but it seems weird to
leave vectors out like that.
 # The {{andThen}} and {{compose}} methods from {{java.util.Function}} don't really provide
the behavior we want when chaining transforms. The JDK versions return new functions that
invoke the original ones in the correct order. What we want in our method is to multiply the
transform matrices together to create a new matrix that mathematically performs the same operations
as if the original matrices were applied in order. So, the end result is the same but the
internals (and performance) are quite different. I think we need a separate method name to
convey this concept. I previously proposed {{transform}} but some other options might be {{build}},
{{combine}}, ...

{quote}Maybe, but caution still applies for anything that goes into the public API. The fluent
API is nice but we should explore the alternatives.
Yes. I do quite like it, though, and I think it will get some good use. Did you have any other
alternatives in mind?
{quote}This is a can of worms, as it will prevent any simple implementation of multi-threaded
I've refactored this in my working branch so that the classes are truly immutable, ie all
fields are final.

> 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