[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-user
Subject:    Re: [math] Point Translation
From:       Curtis Jensen <curtis () the-jensens ! org>
Date:       2011-06-16 19:38:47
Message-ID: BANLkTim5Lr0QsxTRX2-tFOTLFAHYfshsqg () mail ! gmail ! com
[Download RAW message or body]

On Wed, Jun 15, 2011 at 11:57 AM, Luc Maisonobe <Luc.Maisonobe@free.fr> wrote:
> Hi Curtis,
>
> Le 15/06/2011 17:59, Curtis Jensen a écrit :
>>
>> In the commons math 3.0 Geometry package, How can I translate I
>> Vector2D by a distance and angle?
>> I would like to move a 2D point by a specified distance and angle, but
>> I'm not seeing how.
>
> You can use the static method getTransform to convert a
> java.awt.AffineTransform into a
> org.apache.commons.math.geometry.partitioning.Transform<Euclidean2D,
> Euclidean1D>.
>
> This transform can be applied points, hyperplanes and sub-hyperplanes. when
> applied to sub-hyperplanes, it takes care of transforming the 1D intervals
> sets underneath.
>

Using the awt AffineTranform, I would still need to calculate the x
and y translation values myself from the known angle and distance
values.  I only need to translate one point, not a whole system of
points.  The AffineTransform seems like an un-needed step for
translating a single point.  I was hoping for a convenience method, so
I didn't have to write my own translation function on top of commons
math.  I guess ideally, for me, the awt AffineTransform class would
have something like a "getRayTranslationInstance" method, taking in an
angle and distance; probably not gonna happen.  I'll write my own.

Thanks,
Curtis

> Luc
>
>>
>> Thanks,
>> Curtis
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic