MCPcopy Create free account
hub / github.com/Kitware/VTK / ProjectVector

Method ProjectVector

Common/DataModel/vtkPlane.cxx:168–180  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

166
167//------------------------------------------------------------------------------
168void vtkPlane::ProjectVector(
169 const double v[3], const double vtkNotUsed(origin)[3], const double normal[3], double vproj[3])
170{
171 double t = vtkMath::Dot(v, normal);
172 double n2 = vtkMath::Dot(normal, normal);
173 if (n2 == 0)
174 {
175 n2 = 1.0;
176 }
177 vproj[0] = v[0] - t * normal[0] / n2;
178 vproj[1] = v[1] - t * normal[1] / n2;
179 vproj[2] = v[2] - t * normal[2] / n2;
180}
181
182//------------------------------------------------------------------------------
183void vtkPlane::ProjectVector(const double v[3], double vproj[3])

Callers 1

TestPlaneFunction · 0.45

Calls 3

DotFunction · 0.70
GetOriginMethod · 0.45
GetNormalMethod · 0.45

Tested by 1

TestPlaneFunction · 0.36