[Bf-committers] Re: [Bf-blender-cvs] CVS commit:
blender/source/blender/python/api2_2x Mathutils.c
Greg MacDonald
gtmacdonald at gmail.com
Mon Oct 10 19:17:48 CEST 2005
Hi Ken,
Oh I see, you're not confused over the math, you're asking why the dot
product isn't in the range you expected. I tried your code in Blender
2.37aand it returned the expected result of 135. I would try it both
in the CVS
build and 2.37a. If it works in one and not the other then you've probably
found a bug.
-Greg
On 10/10/05, Ken Hughes <khughes at pacific.edu> wrote:
>
> Greg MacDonald wrote:
> > Hi Ken,
> >
> > Probably not.
> >
> > X*Y = |X||Y| cos(theta)
> >
> > The magnitude of either of the two vectors, |X||Y|, can be greater than
> > one. If X and Y are normalized you'll find the dot product will be in
> > that range.
> >
> > On 10/10/05, *Ken Hughes* <khughes at pacific.edu
> > <mailto:khughes at pacific.edu>> wrote:
> >
> > Joseph Gilbert wrote:
> > > ascotan (Joseph Gilbert) 2005/10/10 17:29:00 CEST
> > >
> > > Modified files:
> > > blender/source/blender/python/api2_2x Mathutils.c
> >
> > Shouldn't the dot product be clamped (-1.0,1.0)?
>
> But then the angle between the two vectors has to be in the range or
> 0-90, which isn't right.
>
> #-----------
> import Blender
>
> from Blender.Mathutils import *
>
> v1 = Vector(-1,1,0)
> v2 = Vector (1,0,0)
> print AngleBetweenVecs(v1,v2)
> # ---------
>
> prints "90.0" when it should be 135.0
>
> Ken
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.blender.org/pipermail/bf-committers/attachments/20051010/222fc511/attachment.html
More information about the Bf-committers
mailing list