code: def _quadratic(position: tf.Tensor) -> tf.Tensor:
      """B-Spline basis functions of degree 2 for positions in the range [0, 1]."""
      # We pre-calculate the terms that are used multiple times.
      pos_sq = tf.pow(position, 2.0)
  
      # Piecewise quadratic splines are C1 smooth.
      return tf.stack(
          (
              tf.pow(1.0 - position, 2.0) / 2.0,
              -pos_sq + position + 0.5,
              pos_sq / 2.0,
          ),
          axis=-1,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  from typing import Tuple, Union
  import tensorflow
  from tensorflow_graphics.util import asserts
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util import shape
  from tensorflow_graphics.util import type_alias
label_desc: Use image node_id 3 for calling a global function with example usage: _quadratic(position) and returns: tf