[Bf-python] Mathutils additions

Jonathan Merritt j.merritt at pgrad.unimelb.edu.au
Sat Jul 17 06:09:37 CEST 2004


Hi Campbell,

Campbell Barton wrote:

> Mathutils.getVecDist(vecA, vecB) # measures the distance in 3d space 
> between 2 vectors


Just a question about this one: do you mean the Euclidean distance 
between two points?  ie:
    || A - B ||
Where A and B are the Cartesian locations of a pair of points?

> The names could realy be anything but Im interested to know if I coded 
> this weather people would use it.


Definitely! :-)  I'd just be picky about the name getVecDist() - I'd 
rather see it named getPointDist() or something. 

A "distance between two vectors" is a less well-defined concept, since 
it really only applies in the form above if the two vectors exist in the 
same coordinate system.  Sure, points must *also* be in the same 
coordinate system, but IMHO, that's more obvious.  There are many, many 
cases in 3D graphics where vectors are specified in the same rotational 
coordinate frame (so you can take dot and cross products, etc.), but 
they have an implicit translation offset (eg: the camera view vector and 
a normal to a face, to pick an example off the top of my head).

Jonathan Merritt.



More information about the Bf-python mailing list