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

Function Normalize

Common/DataModel/vtkVector.h:74–87  ·  view source on GitHub ↗

@{ * Normalize the vector in place. * \return The length of the vector. */

Source from the content-addressed store, hash-verified

72 * \return The length of the vector.
73 */
74 double Normalize()
75 {
76 const double norm(this->Norm());
77 if (norm == 0.0)
78 {
79 return 0.0;
80 }
81 const double inv(1.0 / norm);
82 for (int i = 0; i < Size; ++i)
83 {
84 this->Data[i] = static_cast<T>(this->Data[i] * inv);
85 }
86 return norm;
87 }
88 ///@}
89
90 ///@{

Callers 15

DerivativesMethod · 0.70
DerivativesMethod · 0.70
DefineMethod · 0.70
ComputeBoundingSphereMethod · 0.70
InflateMethod · 0.70
Distance2LinePointMethod · 0.70
DerivativesMethod · 0.70
ProjectTo2DMethod · 0.70
operator()Method · 0.70
SetAxisMethod · 0.70

Calls 1

NormMethod · 0.80

Tested by 12

SetupCameraMethod · 0.40
ProjectAlongRayFunction · 0.40
TestValuePass2Function · 0.40
TestCubeAxesInnerGridAllFunction · 0.40
GetTransformFunction · 0.40