nurbsSurface.normalAt

The unit normal ∂S/∂u × ∂S/∂v at (u, v), or null where it vanishes, as at a pole.

GeometricSince 0.4.0

Usage

TypeScript
surface.normalAt(u: number, v: number): Vector3 | null

Parameters

  • unumber

    Knot parameter along u, in domainU.

    Required

  • vnumber

    Knot parameter along v, in domainV.

    Required

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

TypeScript
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 }

See also