The 3D ACIS® Modeler (ACIS) is Spatial’s prominent 3D solid modeling engine. 3D InterOp is a CAD data translation framework (Interoperability)

HowTo:Determine if two vectors are parallel?

From DocR19

Jump to: navigation, search

Call the function(s) parallel in vector.hxx. Alternatively in Scheme, use gvector:parallel?.

Contents

Signature

logical parallel(SPAvector const &v1, SPAvector const &v2, const double res = SPAresnor);
 
logical parallel(SPAunit_vector const &v1, SPAvector const &v2, const double res = SPAresnor);
 
logical parallel(SPAunit_vector const &v1, SPAunit_vector const &v2, const double res = SPAresnor);

Header Files

#include "vector.hxx"


Example

SPAvector v1 = some_vector1;
SPAvector v2 = some_vector2;
logical is_parallel = parallel( v1, v2, SPAresnor );

Scheme Commands

(define g1 (gvector 2 0 0))
(define g2 (gvector 3 0 0))
; gvector:parallel? does not make the distinction between parallel and antiparallel
(gvector:parallel? g1 g2)
;;#t

Notes

  • Two vectors are deemed parallel if the angle between them is less than the angular tolerance (SPAresnor). The user may specify a different tolerance when using parallel.
  • Parallel vectors must also be in the same direction; antiparallel vectors are in opposite directions. Use biparallel, or are_parallel if the sense of the vectors do not matter.

Related Content

Personal tools