Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
π£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
Find vector closest to X_AXIS
-
With a given set of various vectors, how do you determine which one is the one most parallel to another, say the
X_AXIS? -
take the dot product of each vector, normalized, with the vector you are comparing against, normalized.
how_close = vector_a.normalize().dot( comparison_axis ) how_close_b = vector_b.normalize().dot( comparison_axis )the normalize is important because they all need to be the same length for this kind of comparison.
-
Does the direction of the vector matter then?
-
Oops sorry. Meant to tack that on.
dot product = 1 means parallel and in the same direction
dot product = -1 means parallel and in the opposite direction.So if direction matters, look for closest to 1. If it doesn't, use the absolute value.
-
Great! Thank you very much!

Advertisement