Featurescript-Vector rounding
Hugh_Goodbody
Member Posts: 41 PRO
I am computing the dot product of some vectors to check for parallelism. I have run into a rounding error situation. What is the best way to round the vectors so that the values of the highlighted ones are the same?

0
Best Answer
-
if checking parallelism is the only aim you can use parallelVectors() function from standard library
parallelVectors (vector1 is Vector, vector2 is Vector) returns boolean
Returns true if two vectors are parallel (within tolerance).
10
Answers
-
You can use tolerantEquals to compare values with units
https://cad.onshape.com/FsDoc/library.html#ValueWithUnits
Tim Rice | User Experience | Support
Onshape, Inc.0 -
if checking parallelism is the only aim you can use parallelVectors() function from standard library
parallelVectors (vector1 is Vector, vector2 is Vector) returns boolean
Returns true if two vectors are parallel (within tolerance).
10 -
Good to know! Wasn't aware of that function!
0


