resultant_vector

compas_3gs.utilities.resultant_vector(vectors, locations)[source]

Computes the resultant vector of a group of vectors.

Parameters
  • vectors (dictionary) – vector_key-XYZ (vector components) pairs

  • locations (dictionary) – vector_key-XYZ (vector locations) pairs

Returns

  • vector (tuple) – XYZ components of the resultant vector

  • point (tuple) – XYZ coordinates of the location of the resultant vector

Examples

>>> resultant_vector({0 : [ 0.97 , 0.83 , 0.83 ],
                      1 : [ 0.65 , 0.89 , 0.34 ],
                      2 : [ 0.68 , 0.63 , 0.97 ]},
                     {0 : [ 0.97 , 0.83 , 0.83 ],
                      1 : [ 0.65 , 0.89 , 0.34 ],
                      2 : [ 0.68 , 0.63 , 0.97 ]})
[2.3000000000000003, 2.35, 2.1399999999999997]
[0.78129727344020572, 0.78043477156745522, 0.7360930822393742],