On Wed, Jun 15, 2011 at 11:57 AM, Luc Maisonobe <luc.maison...@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-unsubscr...@commons.apache.org
>> For additional commands, e-mail: user-h...@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
>
>

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

Reply via email to