Projects a vector onto a plane, returning a new vector in that plane. The plane is defined by a point and normal vector. The plane normal is the projection direction. If the vector and the normal are aligned, then a degenerate geometry situation is created (a zero vector), but this is not considered an error, since some vector algebra correctly handles zero vectors as intermediate results. Note, however, that handing a zero vector into most geometry-creation functions will cause problems.
projectVector ( v As Vector, _ planePoint As Point, _ nor As Vector ) As Vector
Argument | Type | Description |
---|---|---|
v | Vector | The vector to be projected. |
planePoint | Point | A point on the projection plane. |
nor | Vector | The plane normal vector, and the projection vector. |
Intent >projectVector(UnitX, point(0,0,0), UnitZ) --> Vector_(1.0, 0.0, 0.0, WorldFrame())
Intent >projectVector(UnitX, point(0,0,0), UnitX) --> Vector_(0.0, 0.0, 0.0, WorldFrame())
Intent >projectVector(vector(1,1,1), point(0,0,0), vector(0,0,1)) --> Vector_(1.0, 1.0, 0.0, WorldFrame())
Intent >projectVector(vector(2,2,2), point(0,0,0), vector(1,0,0)) --> Vector_(0.0, 2.0, 2.0, WorldFrame())
Intent >projectVector(vector(0,0,1), point(0,0,0), vector(0,0,1)) --> Vector_(0.0, 0.0, 0.0, WorldFrame())