Vector Math help needed

Hi All,

I can’t figure this out - any help would be appreciated !

I have a point with a bunch of adjacent faces. I have unitized vectors (length=1) representing all of the adjacent faces’ normals (cyan). With vector summation, I can get the unified main vector direction (magenta) but what I need to know also is the LENGTH of that vector that would be precise if all the adjacent faces were offset by 1. See the image below and the file attached representing the problem. This is just a sample, I am looking for a universal method of doing this math for a point with a bunch of adjacent faces


Thanks in advance–


vectors_sample.3dm (74.8 KB)

Hi @Jarek,

in your example case, a single point on the magenta line may exist for all faces, because the angles between all the cyan vectors and the magenta vector are identical. So in this case, it would be enough to create a perpendicular plane to one of the cyan vector lines and set its origin to the end of the vector. (at the arrowhead position, not the unitized vector position). Then you might make a plane / infinite line intersection with the magenta line to get a point on the magenta line. Finally, measure the distance from your initial (center) point to the found intersection point.

If your angles between the magenta vector and all cyan vectors are not identical, i do not think that a single point on the magenta line exists. There will be multiple points on the magenta line. You could proceed as above and generate intersections of perpendicular planes for each cyan vector and then average the point from the points of intersections with the infinite magenta line.

btw. all faces surrounding the origin point must be planar.


Since you are doing this with 3D vectors each one will have beginning and end points which are described by X, Y and Z points in space. Since all of the vectors begin at the same place initially. you can call that point 0,0,0 and determine the coordinates of all of their endpoints as plus or minus X, Y, and Z from that. Then just place the vectors head to tail in succession and “add” up each X, Y and Z coordinate. From the end point of the last vector to the starting point of the first vector you can determine direction and length. In your sample the direction is correct and the length is 2.04.

Hi @clement and @Michael_Edgett, and thanks for your suggestions. They both work in some cases and not in the others. Adding vectors on top of each other (from main point to start-end) gives good direction at the top of the pyramid, but the 2.04 length is not correct. Also, at the base of the pyramid (3 surfaces only) - both direction and length are way off. This method works nicely with a corner of a cube though. So I still can’t figure out the perfect rule for that and I do realize now that with some more irregular shapes there is no obvious 1-point solution.

I had more luck with the plane interserctions that produce correct result in both cases of the pyramid (top and base) and a corner of a cube - in these cases, I create planes from normal vectors, offset them by vector length=1 and run Rhino.IntersectPlanes using any of 3 adjacent face planes - the result is a point that connected with the corner point creates a correct vector direction and length. Since in my case 99% of cases will have 3 adjacent surfaces only I think I will stick with that method.

Thanks again for your help!