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

Function vtkHomogeneousTransformPoint2D

Common/Transforms/vtkTransform2D.cxx:169–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167
168template <class T1, class T2, class T3>
169inline double vtkHomogeneousTransformPoint2D(T1 M[9], const T2 in[2], T3 out[2])
170{
171 double x = M[0] * in[0] + M[1] * in[1] + M[2];
172 double y = M[3] * in[0] + M[4] * in[1] + M[5];
173 double w = M[6] * in[0] + M[7] * in[1] + M[8];
174
175 double f = 1.0 / w;
176 out[0] = static_cast<T3>(x * f);
177 out[1] = static_cast<T3>(y * f);
178
179 return f;
180}
181
182} // End anonymous namespace
183

Callers 2

TransformPointsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected