# Working with Vectors/ Matrices

Hi there,
I’m new to python scripting, and I’d love some help.

I am working on a generalized tool kit for constructing plants with python.
Many of the utilities are straight forward, but some of the math is not for me.

I’d like to know how to get a direction (Vector? or Matrix?) from a location (world origin in this case) to a given location(object location in this case).

Id like to store that value so that i can add points on a curve or whatever else i am doing in that direction. Basically radially outward.

I also wonder how to store that direction without being forced to have that distance from world origin applied to next curve point/leaf/whatever location. (I had a mock-up using a vector that had this problem) Is magnitude in matrices related to this?

have a look at my little ‘place random verts around sphere’ script. http://blenderscripting.blogspot.com/2011/06/randomly-placing-vertices-around.html

you can perform calculations using Vector((x,y,z)), and to make it easier on yourself you work with calculations based on the origin at 0,0,0, then later you translate the coordinate data to where it should be by adding the vectors.