You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Curtis Jensen <cu...@the-jensens.org> on 2011/06/15 19:57:40 UTC
[math] Cross and Dot Product (not centered at the origin)
The Vector2D and Vector3D classes have dotProduct and crossProduct
methods. I assume this is done be considering each vector originating
from the origin. How can the dot product and cross products be
calculated for vectors not centered at the origin?
Thanks,
Curtis
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [math] Cross and Dot Product (not centered at the origin)
Posted by Curtis Jensen <cu...@the-jensens.org>.
On Thu, Jun 16, 2011 at 11:59 PM, Luc Maisonobe <Lu...@free.fr> wrote:
> Le 16/06/2011 21:43, Curtis Jensen a écrit :
>>
>> On Wed, Jun 15, 2011 at 12:01 PM, Luc Maisonobe<Lu...@free.fr>
>> wrote:
>>>
>>> Le 15/06/2011 19:57, Curtis Jensen a écrit :
>>>>
>>>> The Vector2D and Vector3D classes have dotProduct and crossProduct
>>>> methods. I assume this is done be considering each vector originating
>>>
>>> There is no crossProduct in Vector2D in the current version I think.
>>>
>>
>> You are correct. It was sloppy typing on my part to include
>> crossProduct with Vector2D.
>>
>>>> from the origin. How can the dot product and cross products be
>>>> calculated for vectors not centered at the origin?
>>>
>>> Yes, these methods are intended for vectorial spaces, not affine spaces,
>>> which implies they work for vector centered at origin.
>>>
>>> We discussed on the dev list about having separate classes for
>>> Affine/Vectorial spaces and finally decided to merge everything in only
>>> one
>>> class per dimension. This is a classical choice and the user often
>>> already
>>> know what his instances represent.
>>>
>>
>> What is the suggested way of getting the dot and cross products for
>> vectors not centered at the origin? ie. the dot product of a corner
>> of a polygon.
>
> Something along these lines:
>
> Vector3D edge12 = vertex2.subtract(vertex1);
> Vector3D egge23 = vertex3.subtract(vertex2);
> double dot = edge12.dotProduct(edge23);
>
Ah yes; thanks.
--
Curtis
> Luc
>
>>
>> Thanks,
>> Curtis
>>
>>> Luc
>>>
>>>>
>>>> Thanks,
>>>> Curtis
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [math] Cross and Dot Product (not centered at the origin)
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 16/06/2011 21:43, Curtis Jensen a écrit :
> On Wed, Jun 15, 2011 at 12:01 PM, Luc Maisonobe<Lu...@free.fr> wrote:
>> Le 15/06/2011 19:57, Curtis Jensen a écrit :
>>>
>>> The Vector2D and Vector3D classes have dotProduct and crossProduct
>>> methods. I assume this is done be considering each vector originating
>>
>> There is no crossProduct in Vector2D in the current version I think.
>>
>
> You are correct. It was sloppy typing on my part to include
> crossProduct with Vector2D.
>
>>> from the origin. How can the dot product and cross products be
>>> calculated for vectors not centered at the origin?
>>
>> Yes, these methods are intended for vectorial spaces, not affine spaces,
>> which implies they work for vector centered at origin.
>>
>> We discussed on the dev list about having separate classes for
>> Affine/Vectorial spaces and finally decided to merge everything in only one
>> class per dimension. This is a classical choice and the user often already
>> know what his instances represent.
>>
>
> What is the suggested way of getting the dot and cross products for
> vectors not centered at the origin? ie. the dot product of a corner
> of a polygon.
Something along these lines:
Vector3D edge12 = vertex2.subtract(vertex1);
Vector3D egge23 = vertex3.subtract(vertex2);
double dot = edge12.dotProduct(edge23);
Luc
>
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [math] Cross and Dot Product (not centered at the origin)
Posted by Curtis Jensen <cu...@the-jensens.org>.
On Wed, Jun 15, 2011 at 12:01 PM, Luc Maisonobe <Lu...@free.fr> wrote:
> Le 15/06/2011 19:57, Curtis Jensen a écrit :
>>
>> The Vector2D and Vector3D classes have dotProduct and crossProduct
>> methods. I assume this is done be considering each vector originating
>
> There is no crossProduct in Vector2D in the current version I think.
>
You are correct. It was sloppy typing on my part to include
crossProduct with Vector2D.
>> from the origin. How can the dot product and cross products be
>> calculated for vectors not centered at the origin?
>
> Yes, these methods are intended for vectorial spaces, not affine spaces,
> which implies they work for vector centered at origin.
>
> We discussed on the dev list about having separate classes for
> Affine/Vectorial spaces and finally decided to merge everything in only one
> class per dimension. This is a classical choice and the user often already
> know what his instances represent.
>
What is the suggested way of getting the dot and cross products for
vectors not centered at the origin? ie. the dot product of a corner
of a polygon.
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
Re: [math] Cross and Dot Product (not centered at the origin)
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 15/06/2011 19:57, Curtis Jensen a écrit :
> The Vector2D and Vector3D classes have dotProduct and crossProduct
> methods. I assume this is done be considering each vector originating
There is no crossProduct in Vector2D in the current version I think.
> from the origin. How can the dot product and cross products be
> calculated for vectors not centered at the origin?
Yes, these methods are intended for vectorial spaces, not affine spaces,
which implies they work for vector centered at origin.
We discussed on the dev list about having separate classes for
Affine/Vectorial spaces and finally decided to merge everything in only
one class per dimension. This is a classical choice and the user often
already know what his instances represent.
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