nurbsSurface.normalAt
The unit normal ∂S/∂u × ∂S/∂v at (u, v), or null where it vanishes, as at a pole.
Usage
surface.normalAt(u: number, v: number): Vector3 | nullParameters
unumberKnot parameter along u, in domainU.
vnumberKnot parameter along v, in domainV.
Returns
A vector of length 1 along ∂S/∂u × ∂S/∂v; null at a pole or where the partials are parallel or not finite.
Guarantees
- a non-null result has length 1 and is perpendicular to both partials (Vector3.dot ≈ 0)
- The same result on every machine.
Example
const s = NurbsSurface.create([[Point3.of(0, 0, 0), Point3.of(0, 2, 0)], [Point3.of(3, 0, 0), Point3.of(3, 2, 0)]], 1, 1).value
s.normalAt(0.2, 0.7) // → { x: 0, y: 0, z: 1 }