MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / Project

Function Project

TSRigid3D.h:1126–1130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1124 /// \brief Returns the projection of the 3D point $p$ onto the 3D line $l$ under the assumption that the line is unitized.
1125
1126 inline Point3D Project(const Point3D& p, const Line3D& l)
1127 {
1128 float d = Dot(l.v, p);
1129 return (Point3D(d * l.v.x + l.v.y * l.m.z - l.v.z * l.m.y, d * l.v.y + l.v.z * l.m.x - l.v.x * l.m.z, d * l.v.z + l.v.x * l.m.y - l.v.y * l.m.x));
1130 }
1131
1132 /// \brief Returns the projection of the 3D point $p$ onto the 3D plane $g$ under the assumption that the plane is unitized.
1133

Callers

nothing calls this directly

Calls 3

Point3DClass · 0.85
Line3DClass · 0.85
DotFunction · 0.70

Tested by

no test coverage detected