[
https://issues.apache.org/jira/browse/GEOMETRY-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308237#comment-17308237
]
Gilles Sadowski commented on GEOMETRY-118:
------------------------------------------
{quote}
{code:java}
public double transformX(final double x) throws IllegalStateException {
if (m01 != 0.0) {
throw new IllegalStateException(
"maxtrix contains y-shear value, you need to call the two
argument variant of this function");
}
return m00 * x + m02;
}
{code}
{quote}
The {{throws}} clause should not contain unchecked exceptions; those must be
documented with the {{@throws}} Javadoc tag. The error message should describe
the problem, but not try to guess what the caller should have done to prevent
it (this is the role of documentation).
In this instance, I don't get why on the one hand it is assumed that "y has no
influence" while, on the other, there is a check on {{m01}}. If the method
exists for performance reason, the check should be removed.
Why is the one-arg method not using {{LinearCombination}} while the two-args
method is?
> AffineTransformMatrix2D should support direct transformation of x/y values
> --------------------------------------------------------------------------
>
> Key: GEOMETRY-118
> URL: https://issues.apache.org/jira/browse/GEOMETRY-118
> Project: Apache Commons Geometry
> Issue Type: Improvement
> Reporter: Christoph Läubrich
> Priority: Major
>
> [~mattjuntunen] as discussed on the mailinglist, it would be convenient if
> there would be methods to directly transform a single x/y value instead of
> using vectors and/or export the matrix as an array and perform it manually.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)